Skip to content

Commit

Permalink
Avoid QString::null (for Qt6)
Browse files Browse the repository at this point in the history
  • Loading branch information
pljones committed Feb 25, 2022
1 parent 158fa8e commit 28b9175
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/recorder/jamcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ void CJamController::SetRecordingDir ( QString newRecordingDir, int iServerFrame
{
pJamRecorder = new recorder::CJamRecorder ( newRecordingDir, iServerFrameSizeSamples );
strRecorderErrMsg = pJamRecorder->Init();
bRecorderInitialised = ( strRecorderErrMsg == QString::null );
bRecorderInitialised = ( strRecorderErrMsg == QString() );
bEnableRecording = bRecorderInitialised && !bDisableRecording;

qInfo() << qUtf8Printable ( QString ( "Recording state: %1" ).arg ( bEnableRecording ? "enabled" : "disabled" ) );
}
else
{
// This is the only time this is ever true - UI needs to handle it
strRecorderErrMsg = QString::null;
strRecorderErrMsg = QString();
bRecorderInitialised = false;
bEnableRecording = false;

Expand Down
4 changes: 2 additions & 2 deletions src/recorder/jamrecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,11 @@ QMap<QString, QList<STrackItem>> CJamSession::TracksFromSessionDir ( const QStri
/**
* @brief CJamRecorder::Init Create recording directory, if necessary, and connect signal handlers
* @param server Server object emitting signals
* @return QString::null on success else the failure reason
* @return QString() on success else the failure reason
*/
QString CJamRecorder::Init()
{
QString errmsg = QString::null;
QString errmsg = QString();
QFileInfo fi ( recordBaseDir.absolutePath() );
fi.setCaching ( false );

Expand Down
20 changes: 10 additions & 10 deletions src/serverdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ lvwClients->setMinimumHeight ( 140 );
// update GUI dependencies
UpdateGUIDependencies();

UpdateRecorderStatus ( QString::null );
UpdateRecorderStatus ( QString() );

// View menu --------------------------------------------------------------
QMenu* pViewMenu = new QMenu ( tr ( "&Window" ), this );
Expand Down Expand Up @@ -557,19 +557,19 @@ void CServerDlg::OnDirectoryTypeCurrentIndexChanged ( int iTypeIdx )
void CServerDlg::OnServerStarted()
{
UpdateSystemTrayIcon ( true );
UpdateRecorderStatus ( QString::null );
UpdateRecorderStatus ( QString() );
}

void CServerDlg::OnServerStopped()
{
UpdateSystemTrayIcon ( false );
UpdateRecorderStatus ( QString::null );
UpdateRecorderStatus ( QString() );
}

void CServerDlg::OnStopRecorder()
{
UpdateRecorderStatus ( QString::null );
if ( pServer->GetRecorderErrMsg() != QString::null )
UpdateRecorderStatus ( QString() );
if ( pServer->GetRecorderErrMsg() != QString() )
{
QMessageBox::warning ( this,
APP_NAME,
Expand All @@ -592,16 +592,16 @@ void CServerDlg::OnRecordingDirClicked()
if ( newRecordingDir != currentValue )
{
pServer->SetRecordingDir ( newRecordingDir );
UpdateRecorderStatus ( QString::null );
UpdateRecorderStatus ( QString() );
}
}

void CServerDlg::OnClearRecordingDirClicked()
{
if ( pServer->GetRecorderErrMsg() != QString::null || pServer->GetRecordingDir() != "" )
if ( pServer->GetRecorderErrMsg() != QString() || pServer->GetRecordingDir() != "" )
{
pServer->SetRecordingDir ( "" );
UpdateRecorderStatus ( QString::null );
UpdateRecorderStatus ( QString() );
}
}

Expand Down Expand Up @@ -828,7 +828,7 @@ void CServerDlg::UpdateRecorderStatus ( QString sessionDir )
{
if ( pServer->IsRunning() )
{
edtCurrentSessionDir->setText ( sessionDir != QString::null ? sessionDir : "" );
edtCurrentSessionDir->setText ( sessionDir != QString() ? sessionDir : "" );

strRecorderStatus = SREC_RECORDING;
bIsRecording = true;
Expand All @@ -847,7 +847,7 @@ void CServerDlg::UpdateRecorderStatus ( QString sessionDir )
{
strRecordingDir = pServer->GetRecorderErrMsg();

if ( strRecordingDir == QString::null )
if ( strRecordingDir == QString() )
{
strRecordingDir = pServer->GetRecordingDir();
}
Expand Down

0 comments on commit 28b9175

Please sign in to comment.