Minor QString usage improvements

This commit is contained in:
Lukas W
2018-07-11 20:13:47 +02:00
parent 11c693205e
commit c670d4827a
5 changed files with 12 additions and 16 deletions

View File

@@ -95,7 +95,6 @@ TextFloat * TrackContentObjectView::s_textFloat = NULL;
TrackContentObject::TrackContentObject( Track * track ) :
Model( track ),
m_track( track ),
m_name( QString() ),
m_startPosition(),
m_length(),
m_mutedModel( false, this, tr( "Mute" ) ),

View File

@@ -42,9 +42,7 @@
static float floatFromClipboard(bool* ok=nullptr);
AutomatableModelView::AutomatableModelView( ::Model* model, QWidget* _this ) :
ModelView( model, _this ),
m_description( QString() ),
m_unit( QString() )
ModelView( model, _this )
{
widget()->setAcceptDrops( true );
widget()->setCursor( QCursor( embed::getIconPixmap( "hand" ), 3, 3 ) );

View File

@@ -1269,7 +1269,7 @@ void SetupDialog::openWorkingDir()
{
QString new_dir = FileDialog::getExistingDirectory( this,
tr( "Choose LMMS working directory" ), m_workingDir );
if( new_dir != QString() )
if( ! new_dir.isEmpty() )
{
m_wdLineEdit->setText( new_dir );
}
@@ -1280,7 +1280,7 @@ void SetupDialog::openGIGDir()
QString new_dir = FileDialog::getExistingDirectory( this,
tr( "Choose your GIG directory" ),
m_gigDir );
if( new_dir != QString() )
if( ! new_dir.isEmpty() )
{
m_gigLineEdit->setText( new_dir );
}
@@ -1291,7 +1291,7 @@ void SetupDialog::openSF2Dir()
QString new_dir = FileDialog::getExistingDirectory( this,
tr( "Choose your SF2 directory" ),
m_sf2Dir );
if( new_dir != QString() )
if( ! new_dir.isEmpty() )
{
m_sf2LineEdit->setText( new_dir );
}
@@ -1313,7 +1313,7 @@ void SetupDialog::openVSTDir()
QString new_dir = FileDialog::getExistingDirectory( this,
tr( "Choose your VST-plugin directory" ),
m_vstDir );
if( new_dir != QString() )
if( ! new_dir.isEmpty() )
{
m_vdLineEdit->setText( new_dir );
}
@@ -1345,7 +1345,7 @@ void SetupDialog::openArtworkDir()
QString new_dir = FileDialog::getExistingDirectory( this,
tr( "Choose artwork-theme directory" ),
m_artworkDir );
if( new_dir != QString() )
if( ! new_dir.isEmpty() )
{
m_adLineEdit->setText( new_dir );
}
@@ -1367,7 +1367,7 @@ void SetupDialog::openLADSPADir()
QString new_dir = FileDialog::getExistingDirectory( this,
tr( "Choose LADSPA plugin directory" ),
m_ladDir );
if( new_dir != QString() )
if( ! new_dir.isEmpty() )
{
if( m_ladLineEdit->text() == "" )
{
@@ -1389,7 +1389,7 @@ void SetupDialog::openSTKDir()
QString new_dir = FileDialog::getExistingDirectory( this,
tr( "Choose STK rawwave directory" ),
m_stkDir );
if( new_dir != QString() )
if( ! new_dir.isEmpty() )
{
m_stkLineEdit->setText( new_dir );
}
@@ -1406,7 +1406,7 @@ void SetupDialog::openDefaultSoundfont()
tr( "Choose default SoundFont" ), m_defaultSoundfont,
"SoundFont2 Files (*.sf2)" );
if( new_file != QString() )
if( ! new_file.isEmpty() )
{
m_sfLineEdit->setText( new_file );
}
@@ -1439,7 +1439,7 @@ void SetupDialog::openBackgroundArtwork()
tr( "Choose background artwork" ), dir,
"Image Files (" + fileTypes + ")" );
if( new_file != QString() )
if( ! new_file.isEmpty() )
{
m_baLineEdit->setText( new_file );
}