[Hbasic-userinfo] Problem in database window
Status: Beta
Brought to you by:
mengels
From: <mar...@t-...> - 2003-09-15 13:15:18
|
hba...@li... wrote: >Send Hbasic-userinfo mailing list submissions to > hba...@li... > >To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/hbasic-userinfo >or, via email, send a message with subject or body 'help' to > hba...@li... > >You can reach the person managing the list at > hba...@li... > >When replying, please edit your Subject line so it is more specific >than "Re: Contents of Hbasic-userinfo digest..." > > >Today's Topics: > > 1. confusion in database manager ++ (Kim Lilliestierna) > >--__--__-- > >Message: 1 >From: Kim Lilliestierna <ki...@it...> >Organization: Kitrus a.s. >To: hba...@li... >Date: Sun, 7 Sep 2003 13:25:09 +0200 >Subject: [Hbasic-userinfo] confusion in database manager ++ > > >--Boundary-00=_VWxW/l8ithDY5xn >Content-Type: text/plain; > charset="us-ascii" >Content-Transfer-Encoding: 7bit >Content-Disposition: inline > >The Database manger dialog seems a bit confused about >hbdbname an dbname. >the dbname entry will always be sett to the hbdbname. > >anyway attached is a patch for it + a minor patch for a tr( to QObject::tr( in >src/global_commands.cpp that the compiler complained about > >There also seems to be somthing strange with the build system, the QTLIB entry >in Makefile.global is empty after a configure, it should be -lqt-mt... > >A ran this on a RH9.0 with the latest qt/kde compiled via konstruct, i have >both qt and kde in /opt/kde so... > >Configure line for HBasic: >./configure --with-compiler --with-kdeui --with-x \ > --with-qt-libraries=/opt/kde/lib --with-qt-includes=/opt/kde/include \ > --with-kde-libraries=/opt/kde/lib > >--- >Kim "kill" Lilliestiena > > >--Boundary-00=_VWxW/l8ithDY5xn >Content-Type: text/x-diff; > charset="us-ascii"; > name="HBasic-dbdlg.patch" >Content-Transfer-Encoding: 7bit >Content-Disposition: attachment; > filename="HBasic-dbdlg.patch" > >diff -ru HBasic-0.9.8h/gui_db_access/db_dlg_password.cpp Hbasic/gui_db_access/db_dlg_password.cpp >--- HBasic-0.9.8h/gui_db_access/db_dlg_password.cpp 2003-09-07 12:07:01.000000000 +0200 >+++ Hbasic/gui_db_access/db_dlg_password.cpp 2003-09-07 12:37:50.000000000 +0200 >@@ -224,29 +224,45 @@ > void dlgPassword::createConnect( void ) > { > connect( lv_connect_info, SIGNAL( selectionChanged( QListViewItem *)), >- this, SLOT( slotDbSelected( QListViewItem * ))); >- connect( hbdb_name, SIGNAL( textChanged( const QString & )), this, SLOT( slotHbDbNameChanged( const QString & ))); >- connect( db_host, SIGNAL( textChanged( const QString & )), this, SLOT( slotHostChanged( const QString & ))); >- connect( db_name, SIGNAL( textChanged( const QString & )), this, SLOT( slotDbNameChanged( const QString & ))); >- connect( db_desc, SIGNAL( textChanged( const QString & )), this, SLOT( slotDescChanged( const QString & ))); >- connect( db_user, SIGNAL( textChanged( const QString & )), this, SLOT( slotUserChanged( const QString & ))); >- connect( db_password, SIGNAL( textChanged( const QString & )), this, SLOT( slotPasswordChanged( const QString & ))); >- connect( db_driver, SIGNAL( activated( const QString & )), this, SLOT( slotDriverChanged( const QString & ))); >- connect( cb_save_pw, SIGNAL( stateChanged( int )), this, SLOT( slotSavePwChanged( int ))); >+ this, SLOT( slotDbSelected( QListViewItem * ))); >+ connect( hbdb_name, SIGNAL( textChanged( const QString & )), >+ this, SLOT( slotHbDbNameChanged( const QString & ))); >+ connect( db_host, SIGNAL( textChanged( const QString & )), >+ this, SLOT( slotHostChanged( const QString & ))); >+ connect( db_name, SIGNAL( textChanged( const QString & )), >+ this, SLOT( slotDbNameChanged( const QString & ))); >+ connect( db_desc, SIGNAL( textChanged( const QString & )), >+ this, SLOT( slotDescChanged( const QString & ))); >+ connect( db_user, SIGNAL( textChanged( const QString & )), >+ this, SLOT( slotUserChanged( const QString & ))); >+ connect( db_password, SIGNAL( textChanged( const QString & )), >+ this, SLOT( slotPasswordChanged( const QString & ))); >+ connect( db_driver, SIGNAL( activated( const QString & )), >+ this, SLOT( slotDriverChanged( const QString & ))); >+ connect( cb_save_pw, SIGNAL( stateChanged( int )), this, >+ SLOT( slotSavePwChanged( int ))); > } > > void dlgPassword::disconnectEvents( void ) > { > disconnect( lv_connect_info, SIGNAL( selectionChanged( QListViewItem *)), > this, SLOT( slotDbSelected( QListViewItem * ))); >- disconnect( hbdb_name, SIGNAL( textChanged( const QString & )), this, SLOT( slotHbDbNameChanged( const QString & ))); >- disconnect( db_host, SIGNAL( textChanged( const QString & )), this, SLOT( slotHostChanged( const QString & ))); >- disconnect( db_name, SIGNAL( textChanged( const QString & )), this, SLOT( slotDbNameChanged( const QString & ))); >- disconnect( db_desc, SIGNAL( textChanged( const QString & )), this, SLOT( slotDescChanged( const QString & ))); >- disconnect( db_user, SIGNAL( textChanged( const QString & )), this, SLOT( slotUserChanged( const QString & ))); >- disconnect( db_password, SIGNAL( textChanged( const QString & )), this, SLOT( slotPasswordChanged( const QString & ))); >- disconnect( db_driver, SIGNAL( activated( const QString & )), this, SLOT( slotDriverChanged( const QString & ))); >- disconnect( cb_save_pw, SIGNAL( stateChanged( int )), this, SLOT( slotSavePwChanged( int ))); >+ disconnect( hbdb_name, SIGNAL( textChanged( const QString & )), >+ this, SLOT( slotHbDbNameChanged( const QString & ))); >+ disconnect( db_host, SIGNAL( textChanged( const QString & )), >+ this, SLOT( slotHostChanged( const QString & ))); >+ disconnect( db_name, SIGNAL( textChanged( const QString & )), >+ this, SLOT( slotDbNameChanged( const QString & ))); >+ disconnect( db_desc, SIGNAL( textChanged( const QString & )), >+ this, SLOT( slotDescChanged( const QString & ))); >+ disconnect( db_user, SIGNAL( textChanged( const QString & )), >+ this, SLOT( slotUserChanged( const QString & ))); >+ disconnect( db_password, SIGNAL( textChanged( const QString & )), >+ this, SLOT( slotPasswordChanged( const QString & ))); >+ disconnect( db_driver, SIGNAL( activated( const QString & )), >+ this, SLOT( slotDriverChanged( const QString & ))); >+ disconnect( cb_save_pw, SIGNAL( stateChanged( int )), this, >+ SLOT( slotSavePwChanged( int ))); > } > > /* ---------------------------------------------- */ >@@ -344,7 +360,7 @@ > { > if( selected_db != (HBDatabase *)NULL ) > { >- selected_db -> setObjName( (char *)new_dbname . latin1() ); >+ selected_db -> dbname = new QString (new_dbname ); > db_list_changed = TRUE; > showDatabaseList(); > } >@@ -401,8 +417,9 @@ > > selected_db = db_desc_ptr; > >- if( db_desc_ptr -> dbname ) >- hbdb_name -> setText( *(db_desc_ptr -> dbname ) ); >+ >+ if( db_desc_ptr -> HBObject::name() ) >+ hbdb_name -> setText( QString( db_desc_ptr -> HBObject::name() )); > else > hbdb_name -> setText( "" ); > >@@ -419,10 +436,11 @@ > else > db_driver -> setCurrentText( "" ); > >- if( db_desc_ptr -> HBObject::name() ) >- db_name -> setText( QString( db_desc_ptr -> HBObject::name() )); >+ if( db_desc_ptr -> dbname ) >+ db_name -> setText( *(db_desc_ptr -> dbname ) ); > else > db_name -> setText( "" ); >+ > if( db_desc_ptr -> desc ) > db_desc -> setText( *db_desc_ptr -> desc ); > else >diff -ru HBasic-0.9.8h/src/global_commands.cpp Hbasic/src/global_commands.cpp >--- HBasic-0.9.8h/src/global_commands.cpp 2003-09-05 17:01:23.000000000 +0200 >+++ Hbasic/src/global_commands.cpp 2003-09-05 22:39:34.000000000 +0200 >@@ -343,7 +343,7 @@ > > #ifdef INCLUDE_KDEUI > filename = KFileDialog::getSaveFileName( gl_load_dir, >- tr( "*.bas|HBasic Files\n*.*|All files" ), (QWidget *)NULL ); >+ QObject::tr( "*.bas|HBasic Files\n*.*|All files" ), (QWidget *)NULL ); > #else > filename = QFileDialog::getSaveFileName( gl_load_dir, > QObject::tr( "HBasic Files (*.bas);;All Files (*)" ), (QWidget *)NULL ); > >--Boundary-00=_VWxW/l8ithDY5xn-- > > > > >--__--__-- > >_______________________________________________ >Hbasic-userinfo mailing list >Hba...@li... >https://lists.sourceforge.net/lists/listinfo/hbasic-userinfo > > >End of Hbasic-userinfo Digest > Hi Kim, thank you for your information and the patches. I tried to fix the problem with the database names with less changes but you were right that there was a bug exchanging the two database names. I needed the second name to separate two databases with same name (e.g. hbasic) located on different servers. Therefore the first name will be used in HBasic to find the database in the lists of the HBasic object model and the second one is the name of the database on the server. I think the first one (referenced by HBObject::name in the object model) should be the name to select the database. You have changed this so that the edit field dbname for the name of the database on the server will display this name. I will try to fix all the bugs you metioned in the next version of HBasic. Marcus |