1
0
Fork 0

fix: update log commands

development
Bluefissure 2023-07-23 18:14:25 -05:00 committed by Duncan Ogilvie
parent 956072ad02
commit 4c713b08f4
4 changed files with 8 additions and 12 deletions

View File

@ -53,7 +53,7 @@ static bool cbClearLog(int argc, char* argv[])
static bool cbSaveLog(int argc, char* argv[])
{
if(argc < 2)
GuiLogSave(0);
GuiLogSave(nullptr);
else
GuiLogSave(argv[1]);
return true;
@ -61,10 +61,9 @@ static bool cbSaveLog(int argc, char* argv[])
static bool cbRedirectLog(int argc, char* argv[])
{
if(argc < 2)
GuiLogRedirect(0);
else
GuiLogRedirect(argv[1]);
if(IsArgumentsLessThan(argc, 2))
return false;
GuiLogRedirect(argv[1]);
return true;
}

View File

@ -135,10 +135,7 @@ void* Bridge::processMessage(GUIMSG type, void* param1, void* param2)
break;
case GUI_REDIRECT_LOG:
if(!param1)
emit redirectLogToFile(QString());
else
emit redirectLogToFile(QString((const char*)param1));
emit redirectLogToFile(QString((const char*)param1));
break;
case GUI_STOP_REDIRECT_LOG:

View File

@ -41,7 +41,7 @@ LogView::LogView(QWidget* parent) : QTextBrowser(parent), logRedirection(NULL)
connect(Bridge::getBridge(), SIGNAL(saveLog()), this, SLOT(saveSlot()));
connect(Bridge::getBridge(), SIGNAL(saveLogToFile(QString)), this, SLOT(saveSlotToFile(QString)));
connect(Bridge::getBridge(), SIGNAL(redirectLogToFile(QString)), this, SLOT(redirectLogSlotToFile(QString)));
connect(Bridge::getBridge(), SIGNAL(redirectLogStop()), this, SLOT(redirectLogSlotStop()));
connect(Bridge::getBridge(), SIGNAL(redirectLogStop()), this, SLOT(stopRedirectLogSlot()));
connect(Bridge::getBridge(), SIGNAL(setLogEnabled(bool)), this, SLOT(setLoggingEnabled(bool)));
connect(Bridge::getBridge(), SIGNAL(flushLog()), this, SLOT(flushLogSlot()));
connect(this, SIGNAL(anchorClicked(QUrl)), this, SLOT(onAnchorClicked(QUrl)));
@ -379,7 +379,7 @@ void LogView::clearLogSlot()
this->clear();
}
void LogView::redirectLogSlotStop()
void LogView::stopRedirectLogSlot()
{
if(logRedirection != NULL)
{

View File

@ -22,7 +22,7 @@ public slots:
void updateStyle();
void addMsgToLogSlot(QByteArray msg); /* Non-HTML Log Function*/
void addMsgToLogSlotHtml(QByteArray msg); /* HTML accepting Log Function */
void redirectLogSlotStop();
void stopRedirectLogSlot();
void redirectLogSlotToFile(QString directory);
void redirectLogSlot();
void setLoggingEnabled(bool enabled);