|
|
|
@ -238,14 +238,18 @@ quint16 fichePort = 9999; // TODO: config var
|
|
|
|
|
[msgBox, ficheHost, fichePort, pasteUrlFmt, pasteUrlTitle] ( QAbstractButton* button )
|
|
|
|
|
{
|
|
|
|
|
if ( button->text() != tr( "&Yes" ) )
|
|
|
|
|
QApplication::quit();
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
QApplication::quit();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QFile pasteSourceFile( Logger::logFile() );
|
|
|
|
|
if ( !pasteSourceFile.open( QIODevice::ReadOnly | QIODevice::Text ) )
|
|
|
|
|
cError() << "Could not open log file";
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
cError() << "Could not open log file";
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QByteArray pasteData;
|
|
|
|
|
while ( !pasteSourceFile.atEnd() )
|
|
|
|
|
{
|
|
|
|
@ -256,23 +260,32 @@ quint16 fichePort = 9999; // TODO: config var
|
|
|
|
|
socket->connectToHost( ficheHost, fichePort );
|
|
|
|
|
|
|
|
|
|
if ( !socket->waitForConnected() )
|
|
|
|
|
cError() << "Could not connect to paste server";
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
cError() << "Could not connect to paste server";
|
|
|
|
|
socket->close();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cDebug() << "Connected to paste server";
|
|
|
|
|
|
|
|
|
|
socket->write( pasteData );
|
|
|
|
|
|
|
|
|
|
if ( !socket->waitForBytesWritten() )
|
|
|
|
|
cError() << "Could not write to paste server";
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
cError() << "Could not write to paste server";
|
|
|
|
|
socket->close();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cDebug() << "Paste data written to paste server";
|
|
|
|
|
|
|
|
|
|
if ( !socket->waitForReadyRead() )
|
|
|
|
|
cError() << "No data from paste server";
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
cError() << "No data from paste server";
|
|
|
|
|
socket->close();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cDebug() << "Reading response from paste server";
|
|
|
|
|
|
|
|
|
|
char resp[1024];
|
|
|
|
@ -286,17 +299,12 @@ quint16 fichePort = 9999; // TODO: config var
|
|
|
|
|
|
|
|
|
|
QMessageBox* pasteUrlMsgBox = new QMessageBox();
|
|
|
|
|
pasteUrlMsgBox->setIcon( QMessageBox::Critical );
|
|
|
|
|
pasteUrlMsgBox->setWindowTitle( tr( pasteUrlTitle ) );
|
|
|
|
|
pasteUrlMsgBox->setWindowTitle( pasteUrlTitle );
|
|
|
|
|
pasteUrlMsgBox->setStandardButtons( QMessageBox::Close );
|
|
|
|
|
pasteUrlMsgBox->setText( pasteUrlMsg );
|
|
|
|
|
pasteUrlMsgBox->show();
|
|
|
|
|
|
|
|
|
|
connect( pasteUrlMsgBox, &QMessageBox::buttonClicked, qApp, &QApplication::quit );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|