Skip to content

Instantly share code, notes, and snippets.

@RolandHughes
Created February 29, 2024 20:31
Show Gist options
  • Save RolandHughes/84b7951bee1bb526df03c36e21834953 to your computer and use it in GitHub Desktop.
Save RolandHughes/84b7951bee1bb526df03c36e21834953 to your computer and use it in GitHub Desktop.
Snippet to test line range upload
void EdtBaseWidget::sendToGitHubFinished( )
{
// bit risky here but only way to do it.
// well, I could have hacked a lambda but that has its own issues.
//
QObject *p = sender();
QNetworkReply *rep = qobject_cast< QNetworkReply *>( p );
if ( rep != nullptr )
{
if ( rep->error() == QNetworkReply::NoError )
{
QByteArray data = rep->readAll();
displayGistPostSuccess( data );
}
else
{
QString msg = QStringParser::formatArg( QString( "Error: %1 " ), rep->error() );
QMessageBox::warning( this, QString( "Github Gist Post error" ), msg );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment