simplify isProfileDeletable

Summary: Maintenability ++

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: ahmadsamir, konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D13516
wilder-portage
Tomaz Canabrava 8 years ago committed by Kurt Hindenburg
parent 474c06d5a5
commit 68ddd7b978
  1. 22
      src/settings/ProfileSettings.cpp

@ -381,19 +381,17 @@ Profile::Ptr ProfileSettings::currentProfile() const
}
bool ProfileSettings::isProfileDeletable(Profile::Ptr profile) const
{
if (profile) {
QFileInfo fileInfo(profile->path());
if (fileInfo.exists()) {
// check whether user has enough permission
QFileInfo dirInfo(fileInfo.path());
return dirInfo.isWritable();
} else {
return true;
}
} else {
return true;
if (!profile) {
return false;
}
const QFileInfo fileInfo(profile->path());
if (!fileInfo.exists()) {
return false;
}
const QFileInfo dirInfo(fileInfo.path());
return dirInfo.isWritable();
}
void ProfileSettings::updateFavoriteStatus(Profile::Ptr profile, bool favorite)
{

Loading…
Cancel
Save