mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-06-03 01:22:42 +02:00
2016-07-21 Fred Gleason <fredg@paravelsystems.com>
* Fixed a bug in 'utils/rdclilogedit/rdclilogedit.cpp' that caused large output listings to be truncated.
This commit is contained in:
parent
f4cf690ff3
commit
deeadbf0e9
@ -15337,3 +15337,6 @@
|
||||
2016-07-20 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Fixed a bug in 'utils/rdclilogedit/rdclilogedit.cpp' that caused
|
||||
segfaults with certain commands when run without a log loaded.
|
||||
2016-07-21 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Fixed a bug in 'utils/rdclilogedit/rdclilogedit.cpp' that caused
|
||||
large output listings to be truncated.
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include <qapplication.h>
|
||||
#include <qcstring.h>
|
||||
#include <qfile.h>
|
||||
#include <qstringlist.h>
|
||||
|
||||
@ -169,7 +170,7 @@ void MainObject::ListLogs() const
|
||||
sql=QString("select NAME from LOGS order by NAME");
|
||||
q=new RDSqlQuery(sql);
|
||||
while(q->next()) {
|
||||
printf("%s\n",(const char *)q->value(0).toString());
|
||||
Print(QString().sprintf("%s\n",(const char *)q->value(0).toString()));
|
||||
}
|
||||
delete q;
|
||||
}
|
||||
@ -201,7 +202,8 @@ void MainObject::Load(const QString &logname)
|
||||
void MainObject::List()
|
||||
{
|
||||
for(int i=0;i<edit_log_event->size();i++) {
|
||||
printf("%4d %s\n",i,(const char *)ListLine(edit_log_event,i));
|
||||
Print(QString().sprintf("%4d %s\n",i,
|
||||
(const char *)ListLine(edit_log_event,i)));
|
||||
}
|
||||
fflush(stdout);
|
||||
}
|
||||
@ -313,6 +315,13 @@ void MainObject::Unload()
|
||||
}
|
||||
|
||||
|
||||
void MainObject::Print(const QString &str) const
|
||||
{
|
||||
printf("%s",(const char *)str);
|
||||
usleep(10);
|
||||
}
|
||||
|
||||
|
||||
void MainObject::DispatchCommand(const QString &cmd)
|
||||
{
|
||||
QStringList cmds=cmds.split(" ",cmd);
|
||||
@ -611,10 +620,10 @@ QString MainObject::ListLine(RDLogEvent *evt,int line) const
|
||||
void MainObject::PrintPrompt() const
|
||||
{
|
||||
if(edit_log==NULL) {
|
||||
printf("logedit> ");
|
||||
Print("logedit> ");
|
||||
}
|
||||
else {
|
||||
printf("logedit [%s]> ",(const char *)edit_log->name());
|
||||
Print(QString().sprintf("logedit [%s]> ",(const char *)edit_log->name()));
|
||||
}
|
||||
fflush(stdout);
|
||||
}
|
||||
|
@ -58,6 +58,7 @@ class MainObject : public QObject
|
||||
void Settime(int line,RDLogLine::TimeType type,const QTime &time=QTime());
|
||||
void Settrans(int line,RDLogLine::TransType type);
|
||||
void Unload();
|
||||
void Print(const QString &str) const;
|
||||
void DispatchCommand(const QString &cmd);
|
||||
QString ListLine(RDLogEvent *evt,int line) const;
|
||||
void PrintPrompt() const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user