Verified Commit f40db6fb authored by Snehit Sah's avatar Snehit Sah
Browse files

Simplify condition checks



if( expr == true ) is now if( expr )
if( expr == false ) is now if( !expr )
Signed-off-by: Snehit Sah's avatarSnehit Sah <snehitsah@protonmail.com>
parent 7ca2f908
Pipeline #128059 passed with stage
in 1 minute and 59 seconds
......@@ -212,7 +212,7 @@ void KDFWidget::loadSettings( void )
**/
void KDFWidget::settingsBtnClicked( void )
{
if( mIsTopLevel == true )
if( mIsTopLevel )
{
if( mOptionDialog == nullptr )
{
......@@ -350,7 +350,7 @@ QIcon KDFWidget::generateIcon( const QString &iconName, bool mode, bool mounted)
void KDFWidget::criticallyFull( DiskEntry *disk )
{
if( mStd.popupIfFull() == true )
if( mStd.popupIfFull() )
{
QString msg = i18n("Device [%1] on [%2] is critically full.",
disk->deviceName(), disk->mountPoint());
......@@ -435,7 +435,7 @@ void KDFWidget::contextMenuRequested( const QPoint &p )
{
KMessageBox::error( this, disk->lastSysError() );
}
else if ( ( mStd.openFileManager() == true)
else if ( mStd.openFileManager()
&& (position == mountPointAction) ) //only on mount
{
openFileManager = true;
......@@ -449,14 +449,14 @@ void KDFWidget::contextMenuRequested( const QPoint &p )
openFileManager = true;
}
if( openFileManager == true )
if( openFileManager )
{
qCDebug(KDF) << "opening filemanager";
if( mStd.useSystemFileManager() == true )
if( mStd.useSystemFileManager() )
{
QDesktopServices::openUrl( QUrl::fromLocalFile( disk->mountPoint() ) );
}
else if( mStd.fileManager().isEmpty() == false )
else if( !mStd.fileManager().isEmpty() )
{
QString cmd = mStd.fileManager();
int pos = cmd.indexOf(QLatin1String( "%m" ));
......
......@@ -235,10 +235,10 @@ void KwikDisk::toggleMount(QAction * action)
{
KMessageBox::error(nullptr, disk->lastSysError());
}
else if( (m_options.openFileManager() == true) && (disk->mounted() == true ) )
else if( m_options.openFileManager() && ( disk->mounted() ) )
{
qCDebug(KDF) << "opening filemanager";
if( m_options.fileManager().isEmpty() == false )
if( !m_options.fileManager().isEmpty() )
{
QString cmd = m_options.fileManager();
int pos = cmd.indexOf(QLatin1String( "%m" ));
......
......@@ -148,7 +148,7 @@ void MntConfigWidget::applySettings( void )
void MntConfigWidget::loadSettings( void )
{
KConfigGroup config = KSharedConfig::openConfig()->group("MntConfig");
if( mInitializing == false && GUI )
if( !mInitializing && GUI )
{
if( isTopLevel() )
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment