Commit 4ce7d207 authored by Laurent Montel's avatar Laurent Montel 😁

Modernize code

parent 292bdc0e
Pipeline #33435 passed with stage
in 63 minutes and 38 seconds
......@@ -24,18 +24,6 @@
using namespace PimCommon;
AutoCorrection::AutoCorrection()
: mSingleSpaces(true)
, mUppercaseFirstCharOfSentence(false)
, mFixTwoUppercaseChars(false)
, mAutoFractions(true)
, mCapitalizeWeekDays(false)
, mReplaceDoubleQuotes(false)
, mReplaceSingleQuotes(false)
, mEnabled(false)
, mSuperScriptAppendix(false)
, mAddNonBreakingSpace(false)
, mMaxFindStringLenght(0)
, mMinFindStringLenght(0)
{
mNonBreakingSpace = QChar(QChar::Nbsp);
// default double quote open 0x201c
......
......@@ -108,24 +108,24 @@ private:
bool excludeToUppercase(const QString &word) const;
QColor linkColor();
bool mSingleSpaces; // suppress double spaces.
bool mUppercaseFirstCharOfSentence; // convert first letter of a sentence automaticall to uppercase
bool mFixTwoUppercaseChars; // convert two uppercase characters to one upper and one lowercase.
bool mAutoFractions; // replace 1/2 with ½
bool mCapitalizeWeekDays;
bool mAdvancedAutocorrect; // autocorrection from a list of entries
bool mReplaceDoubleQuotes; // replace double quotes with typographical quotes
bool mReplaceSingleQuotes; // replace single quotes with typographical quotes
bool mAutoFormatUrl;
bool mAutoBoldUnderline;
bool mEnabled;
bool mSuperScriptAppendix;
bool mAddNonBreakingSpace;
int mMaxFindStringLenght;
int mMinFindStringLenght;
bool mSingleSpaces = true; // suppress double spaces.
bool mUppercaseFirstCharOfSentence = false; // convert first letter of a sentence automaticall to uppercase
bool mFixTwoUppercaseChars = false; // convert two uppercase characters to one upper and one lowercase.
bool mAutoFractions = true; // replace 1/2 with ½
bool mCapitalizeWeekDays = false;
bool mAdvancedAutocorrect = false; // autocorrection from a list of entries
bool mReplaceDoubleQuotes = false; // replace double quotes with typographical quotes
bool mReplaceSingleQuotes = false; // replace single quotes with typographical quotes
bool mAutoFormatUrl = false;
bool mAutoBoldUnderline = false;
bool mEnabled = false;
bool mSuperScriptAppendix = false;
bool mAddNonBreakingSpace = false;
int mMaxFindStringLenght = 0;
int mMinFindStringLenght = 0;
QString mWord;
QTextCursor mCursor;
QChar mNonBreakingSpace;
......
......@@ -46,7 +46,7 @@ public:
QSet<QString> m_upperCaseExceptions;
QSet<QString> m_twoUpperLetterExceptions;
QHash<QString, QString> m_autocorrectEntries;
Ui::AutoCorrectionWidget *ui = nullptr;
Ui::AutoCorrectionWidget *const ui;
AutoCorrection *mAutoCorrection = nullptr;
bool mWasChanged = false;
};
......
......@@ -50,7 +50,7 @@ protected:
QHash<QString, QString> mSuperScriptEntries;
AutoCorrection::TypographicQuotes mTypographicSingleQuotes;
AutoCorrection::TypographicQuotes mTypographicDoubleQuotes;
QWidget *mParent = nullptr;
QWidget *const mParent;
};
}
......
......@@ -11,10 +11,6 @@ using namespace PimCommon;
class PimCommon::CustomToolsPluginPrivate
{
public:
CustomToolsPluginPrivate()
{
}
bool enabled = false;
};
......
......@@ -20,12 +20,7 @@ using namespace PimCommon;
class CustomToolsPluginInfo
{
public:
CustomToolsPluginInfo()
: plugin(nullptr)
{
}
QString saveName() const;
Q_REQUIRED_RESULT QString saveName() const;
KPluginMetaData metaData;
PimCommon::CustomToolsPlugin *plugin = nullptr;
......
......@@ -17,7 +17,6 @@ class PimCommon::LogActivitiesManagerPrivate
{
public:
LogActivitiesManagerPrivate()
: mDialog(nullptr)
{
}
......
......@@ -12,8 +12,8 @@ Q_GLOBAL_STATIC(NetworkManager, s_pNetworkManagerSelf)
NetworkManager::NetworkManager(QObject *parent)
: QObject(parent)
, mNetworkConfigureManager(new QNetworkConfigurationManager())
{
mNetworkConfigureManager = new QNetworkConfigurationManager();
}
NetworkManager::~NetworkManager()
......
......@@ -26,7 +26,7 @@ public:
Q_REQUIRED_RESULT QNetworkConfigurationManager *networkConfigureManager() const;
private:
QNetworkConfigurationManager *mNetworkConfigureManager = nullptr;
QNetworkConfigurationManager *const mNetworkConfigureManager;
};
}
......
......@@ -48,7 +48,7 @@ private:
QString mResult;
QString mJsonData;
QString mJsonDebug;
QNetworkAccessManager *mNetworkAccessManager = nullptr;
QNetworkAccessManager *const mNetworkAccessManager;
QWidget *mParentWidget = nullptr;
bool mDebug = false;
};
......
......@@ -30,9 +30,9 @@ public:
{
}
QString suggestName(const QUrl &baseURL, const QString &oldName);
Q_REQUIRED_RESULT QString suggestName(const QUrl &baseURL, const QString &oldName);
QUrl url;
const QUrl url;
QCheckBox *applyAll = nullptr;
QPushButton *renameBtn = nullptr;
QPushButton *suggestNewNameBtn = nullptr;
......
......@@ -12,7 +12,6 @@ using namespace PimCommon;
AclListView::AclListView(QWidget *parent)
: QListView(parent)
, mCanBeAdministrated(true)
{
}
......
......@@ -26,7 +26,7 @@ protected:
private:
void generalPaletteChanged();
QColor mTextColor;
bool mCanBeAdministrated;
bool mCanBeAdministrated = true;
};
}
#endif // ACLLISTVIEW_H
......@@ -27,7 +27,6 @@ class ActionButton : public QPushButton
public:
ActionButton(QWidget *parent = nullptr)
: QPushButton(parent)
, mDefaultAction(nullptr)
{
}
......
......@@ -26,7 +26,7 @@ public:
void loadBalooBlackList();
Q_REQUIRED_RESULT QStringList cleanupEmailList(const QStringList &inputList);
private:
PimCommon::BalooCompletionEmail *mBalooCompletionEmail = nullptr;
PimCommon::BalooCompletionEmail *const mBalooCompletionEmail;
QStringList mBalooBlackList;
QStringList mDomainExcludeList;
......
......@@ -24,9 +24,7 @@ using namespace PimCommon;
Q_GLOBAL_STATIC(AddresseeLineEditManager, sInstance)
AddresseeLineEditManager::AddresseeLineEditManager()
: mShowOU(false)
, mAutoGroupExpand(false)
, mCompletion(new KMailCompletion)
: mCompletion(new KMailCompletion)
, mAddresseeLineEditAkonadi(new AddresseeLineEditAkonadi)
, mAddressessLineEditLdap(new AddresseeLineEditLdap(this))
, mAddressessLineEditBaloo(new AddresseeLineEditBaloo)
......
......@@ -119,11 +119,11 @@ private:
mutable QColor mAlternateColor;
bool mShowOU = false;
bool mAutoGroupExpand = false;
KMailCompletion *mCompletion = nullptr;
AddresseeLineEditAkonadi *mAddresseeLineEditAkonadi = nullptr;
AddresseeLineEditLdap *mAddressessLineEditLdap = nullptr;
AddresseeLineEditBaloo *mAddressessLineEditBaloo = nullptr;
QNetworkConfigurationManager *mNetworkConfigMgr = nullptr;
KMailCompletion *const mCompletion;
AddresseeLineEditAkonadi *const mAddresseeLineEditAkonadi;
AddresseeLineEditLdap *const mAddressessLineEditLdap;
AddresseeLineEditBaloo *const mAddressessLineEditBaloo;
QNetworkConfigurationManager *const mNetworkConfigMgr;
};
}
#endif // ADDRESSEELINEEDITMANAGER_H
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