2018-11-15 Fred Gleason <fredg@paravelsystems.com>

* Fixed a bug in rdadmin(1) that prevented login from a system with
	no host record in the database.
This commit is contained in:
Fred Gleason 2018-11-15 14:39:00 -05:00
parent e8c619988f
commit fa7918d158
3 changed files with 19 additions and 12 deletions

View File

@ -18012,3 +18012,6 @@
test harness.
* Added an 'audio_metadata_test' test harness.
* Modified ID3 tag reading/writing to use TagLib.
2018-11-15 Fred Gleason <fredg@paravelsystems.com>
* Fixed a bug in rdadmin(1) that prevented login from a system with
no host record in the database.

View File

@ -145,15 +145,6 @@ bool RDApplication::open(QString *err_msg,RDApplication::ErrorType *err_type)
// Open Accessors
//
app_station=new RDStation(app_config->stationName());
if(!app_station->exists()) {
if(err_type!=NULL) {
*err_type=RDApplication::ErrorNoHostEntry;
}
*err_msg=QObject::tr("This host")+" (\""+app_config->stationName()+"\") "+
QObject::tr("does not have a Hosts entry in the database.")+"\n"+
QObject::tr("Open RDAdmin->ManageHosts->Add to create one.");
return false;
}
app_system=new RDSystem();
app_library_conf=new RDLibraryConf(app_config->stationName());
app_logedit_conf=new RDLogeditConf(app_config->stationName());
@ -164,6 +155,16 @@ bool RDApplication::open(QString *err_msg,RDApplication::ErrorType *err_type)
app_ripc=new RDRipc(app_station,app_config,this);
connect(app_ripc,SIGNAL(userChanged()),this,SLOT(userChangedData()));
if(!app_station->exists()) {
if(err_type!=NULL) {
*err_type=RDApplication::ErrorNoHostEntry;
}
*err_msg=QObject::tr("This host")+" (\""+app_config->stationName()+"\") "+
QObject::tr("does not have a Hosts entry in the database.")+"\n"+
QObject::tr("Open RDAdmin->ManageHosts->Add to create one.");
return false;
}
return true;
}

View File

@ -82,6 +82,7 @@ MainWidget::MainWidget(QWidget *parent)
{
QString str;
QString err_msg;
RDApplication::ErrorType err_type=RDApplication::ErrorOk;
//
// Fix the Window Size
@ -110,9 +111,11 @@ MainWidget::MainWidget(QWidget *parent)
// Open the Database
//
rda=new RDApplication("RDAdmin","rdadmin",RDADMIN_USAGE,this);
if(!rda->open(&err_msg)) {
QMessageBox::critical(this,"RDAdmin - "+tr("Error"),err_msg);
exit(1);
if(!rda->open(&err_msg,&err_type)) {
if(err_type!=RDApplication::ErrorNoHostEntry) {
QMessageBox::critical(this,"RDAdmin - "+tr("Error"),err_msg);
exit(1);
}
}
setWindowTitle(QString("RDAdmin v")+VERSION+" - "+
tr("Host")+": "+rda->config()->stationName());