mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-13 06:03:37 +02:00
2017-10-15 Fred Gleason <fredg@paravelsystems.com>
* Added a 'STATIONS.SHORT_NAME' field to the database. * Incremented the database version to 270. * Added 'RDStation::shortName()' and 'RDStation::setShortName()' methods. * Removed the 'Broadcast Security Model' control from the 'Edit Host' dialog. * Added a 'Short Name' control to the 'Edit Host' dialog. * Implemented a '%R' wildcard for Rivendell Host Short Name.
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
|
||||
#include <rdcmd_switch.h>
|
||||
#include <rddatedecode.h>
|
||||
#include <rddb.h>
|
||||
|
||||
#include "datedecode_test.h"
|
||||
|
||||
@@ -35,6 +36,7 @@ MainObject::MainObject(QObject *parent)
|
||||
QString date="";
|
||||
QString datetime="";
|
||||
QString service="";
|
||||
unsigned schema=0;
|
||||
|
||||
//
|
||||
// Read Command Options
|
||||
@@ -78,17 +80,30 @@ MainObject::MainObject(QObject *parent)
|
||||
RDConfig *config=new RDConfig();
|
||||
config->load();
|
||||
|
||||
//
|
||||
// Open Database
|
||||
//
|
||||
QString err (tr("datedecode_test: "));
|
||||
QSqlDatabase *db=RDInitDb(&schema,&err);
|
||||
if(!db) {
|
||||
fprintf(stderr,err.ascii());
|
||||
delete cmd;
|
||||
exit(256);
|
||||
}
|
||||
RDStation *station=new RDStation(config->stationName());
|
||||
|
||||
//
|
||||
// Process Code
|
||||
//
|
||||
if(!date.isEmpty()) {
|
||||
printf("%s\n",
|
||||
(const char *)RDDateDecode(date,QDate::currentDate(),config,
|
||||
(const char *)RDDateDecode(date,QDate::currentDate(),station,config,
|
||||
service));
|
||||
}
|
||||
if(!datetime.isEmpty()) {
|
||||
printf("%s\n",(const char *)RDDateTimeDecode(datetime,
|
||||
QDateTime(QDate::currentDate(),QTime::currentTime()),config,service));
|
||||
QDateTime(QDate::currentDate(),QTime::currentTime()),station,
|
||||
config,service));
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user