Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit a015c038 authored by Laurent Montel's avatar Laurent Montel 😁

Minor optimization

parent 68cb029e
......@@ -33,7 +33,7 @@ using namespace MailCommon;
class MailCommon::SnippetItem
{
public:
SnippetItem(bool isGroup = false, SnippetItem *parent = nullptr);
explicit SnippetItem(bool isGroup = false, SnippetItem *parent = nullptr);
~SnippetItem();
bool isGroup() const;
......@@ -461,7 +461,7 @@ void SnippetsModel::load()
const QString groupName = group.readEntry("Name");
// create group
QModelIndex groupIndex = createGroup(groupName);
const QModelIndex groupIndex = createGroup(groupName);
const int snippetCount = group.readEntry("snippetCount", 0);
for (int j = 0; j < snippetCount; ++j) {
......@@ -478,7 +478,6 @@ void SnippetsModel::load()
}
}
mSavedVariables.clear();
const KConfigGroup group = config->group("SavedVariablesPart");
const int variablesCount = group.readEntry("variablesCount", 0);
......
......@@ -72,7 +72,6 @@ public:
Q_REQUIRED_RESULT Qt::DropActions supportedDropActions() const override;
void load();
void save();
Q_REQUIRED_RESULT QMap<QString, QString> savedVariables() const;
......@@ -91,6 +90,7 @@ Q_SIGNALS:
void updateActionCollection(const QString &oldName, const QString &newName, const QKeySequence &keySequence, const QString &text);
private:
void load();
QModelIndex createGroup(const QString &groupName);
void createSnippet(const QModelIndex &groupIndex, const QString &snippetName, const QString &snippetText, const QString &snippetKeySequence);
SnippetItem *mRootItem = nullptr;
......
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