Commit 72b19ee1 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Rename as foldersettings as discussed with david

parent 779f8f10
cmake_minimum_required(VERSION 3.0)
set(PIM_VERSION "5.5.42")
set(PIM_VERSION "5.5.43")
project(mailcommon VERSION ${PIM_VERSION})
......
......@@ -95,7 +95,7 @@ set(libmailcommon_collection_SRCS
)
set(libmailcommon_folder_SRCS
folder/foldercollection.cpp
folder/foldersettings.cpp
folder/foldercollectionmonitor.cpp
folder/folderrequester.cpp
folder/folderselectiondialog.cpp
......@@ -299,7 +299,7 @@ ecm_generate_headers(MailCommon_Camelcasetag_HEADERS
ecm_generate_headers(MailCommon_Camelcasefolder_HEADERS
HEADER_NAMES
FolderCollection
FolderSettings
FolderRequester
FolderCollectionMonitor
AccountConfigOrderDialog
......
......@@ -17,7 +17,7 @@
*/
#include "expirecollectionattribute.h"
#include "folder/foldercollection.h"
#include "folder/foldersettings.h"
#include "kernel/mailkernel.h"
#include <KConfigGroup>
......
......@@ -20,7 +20,7 @@
#include "attributes/expirecollectionattribute.h"
#include "folder/folderrequester.h"
#include "folder/foldercollection.h"
#include "folder/foldersettings.h"
#include "util/mailutil.h"
#include "kernel/mailkernel.h"
#include "mailcommon_debug.h"
......@@ -53,7 +53,7 @@ CollectionExpiryPage::~CollectionExpiryPage()
bool CollectionExpiryPage::canHandle(const Akonadi::Collection &col) const
{
QSharedPointer<FolderCollection> fd = FolderCollection::forCollection(col, false);
QSharedPointer<FolderSettings> fd = FolderSettings::forCollection(col, false);
return (fd->canDeleteMessages() && !fd->isStructural());
}
......
......@@ -21,7 +21,7 @@
#include "incidencesforwidget.h"
#include <PimCommonAkonadi/ContentTypeWidget>
#include <PimCommonAkonadi/CollectionAnnotationsAttribute>
#include "folder/foldercollection.h"
#include "folder/foldersettings.h"
#include "kernel/mailkernel.h"
#include "util/mailutil_p.h"
......@@ -230,7 +230,7 @@ void CollectionGeneralPage::init(const Akonadi::Collection &collection)
void CollectionGeneralPage::load(const Akonadi::Collection &collection)
{
mFolderCollection = FolderCollection::forCollection(collection);
mFolderCollection = FolderSettings::forCollection(collection);
init(collection);
if (mNameEdit) {
......
......@@ -40,7 +40,7 @@ class QVBoxLayout;
namespace MailCommon
{
class FolderCollection;
class FolderSettings;
class MAILCOMMON_EXPORT CollectionGeneralPage : public Akonadi::CollectionPropertiesPage
{
Q_OBJECT
......@@ -72,7 +72,7 @@ private:
QCheckBox *mUseDefaultIdentityCheckBox;
KLineEdit *mNameEdit;
KIdentityManagement::IdentityCombo *mIdentityComboBox;
QSharedPointer<MailCommon::FolderCollection> mFolderCollection;
QSharedPointer<MailCommon::FolderSettings> mFolderCollection;
bool mIsLocalSystemFolder;
bool mIsResourceFolder;
};
......
......@@ -17,7 +17,7 @@
#include "foldercollectionmonitor.h"
#include "util/mailutil.h"
#include "foldercollection.h"
#include "foldersettings.h"
#include "mailcommon_debug.h"
#include <ChangeRecorder>
#include <Collection>
......
......@@ -18,7 +18,7 @@
#include "folderselectiondialog.h"
#include "foldercollection.h"
#include "foldersettings.h"
#include "foldertreeview.h"
#include "foldertreewidget.h"
#include "foldertreewidgetproxymodel.h"
......@@ -240,7 +240,7 @@ void FolderSelectionDialog::slotSelectionChanged()
Akonadi::Collection parent;
d->mUser1Button->setEnabled(canCreateCollection(parent));
if (parent.isValid()) {
const QSharedPointer<FolderCollection> fd(FolderCollection::forCollection(parent, false));
const QSharedPointer<FolderSettings> fd(FolderSettings::forCollection(parent, false));
d->mOkButton->setEnabled(fd->canCreateMessages());
}
}
......
......@@ -16,7 +16,7 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "foldercollection.h"
#include "foldersettings.h"
#include "kernel/mailkernel.h"
#include "util/mailutil.h"
#include "util/resourcereadconfigfile.h"
......@@ -40,17 +40,17 @@ namespace MailCommon
{
static QMutex mapMutex;
static QMap<Collection::Id, QSharedPointer<FolderCollection> > fcMap;
static QMap<Collection::Id, QSharedPointer<FolderSettings> > fcMap;
QSharedPointer<FolderCollection> FolderCollection::forCollection(
QSharedPointer<FolderSettings> FolderSettings::forCollection(
const Akonadi::Collection &coll, bool writeConfig)
{
QMutexLocker lock(&mapMutex);
QSharedPointer<FolderCollection> sptr = fcMap.value(coll.id());
QSharedPointer<FolderSettings> sptr = fcMap.value(coll.id());
if (!sptr) {
sptr = QSharedPointer<FolderCollection>(new FolderCollection(coll, writeConfig));
sptr = QSharedPointer<FolderSettings>(new FolderSettings(coll, writeConfig));
fcMap.insert(coll.id(), sptr);
} else {
sptr->setCollection(coll);
......@@ -62,7 +62,7 @@ QSharedPointer<FolderCollection> FolderCollection::forCollection(
return sptr;
}
FolderCollection::FolderCollection(const Akonadi::Collection &col, bool writeconfig)
FolderSettings::FolderSettings(const Akonadi::Collection &col, bool writeconfig)
: mCollection(col),
mFormatMessage(MessageViewer::Viewer::Unknown),
mPutRepliesInSameFolder(false),
......@@ -77,7 +77,7 @@ FolderCollection::FolderCollection(const Akonadi::Collection &col, bool writecon
this, SLOT(slotIdentitiesChanged()));
}
FolderCollection::~FolderCollection()
FolderSettings::~FolderSettings()
{
//qCDebug(MAILCOMMON_LOG)<<" FolderCollection::~FolderCollection"<<this;
if (mWriteConfig) {
......@@ -85,93 +85,93 @@ FolderCollection::~FolderCollection()
}
}
MessageViewer::Viewer::DisplayFormatMessage FolderCollection::formatMessage() const
MessageViewer::Viewer::DisplayFormatMessage FolderSettings::formatMessage() const
{
return mFormatMessage;
}
void FolderCollection::setFormatMessage(MessageViewer::Viewer::DisplayFormatMessage formatMessage)
void FolderSettings::setFormatMessage(MessageViewer::Viewer::DisplayFormatMessage formatMessage)
{
mFormatMessage = formatMessage;
}
void FolderCollection::clearCache()
void FolderSettings::clearCache()
{
QMutexLocker lock(&mapMutex);
fcMap.clear();
}
void FolderCollection::resetHtmlFormat()
void FolderSettings::resetHtmlFormat()
{
QMutexLocker lock(&mapMutex);
QMap<Collection::Id, QSharedPointer<FolderCollection> >::const_iterator i = fcMap.constBegin();
QMap<Collection::Id, QSharedPointer<FolderSettings> >::const_iterator i = fcMap.constBegin();
while (i != fcMap.constEnd()) {
i.value()->setFormatMessage(MessageViewer::Viewer::UseGlobalSetting);
++i;
}
}
bool FolderCollection::isWriteConfig() const
bool FolderSettings::isWriteConfig() const
{
return mWriteConfig;
}
void FolderCollection::setWriteConfig(bool writeConfig)
void FolderSettings::setWriteConfig(bool writeConfig)
{
mWriteConfig = writeConfig;
}
QString FolderCollection::name() const
QString FolderSettings::name() const
{
return mCollection.name();
}
bool FolderCollection::isSystemFolder() const
bool FolderSettings::isSystemFolder() const
{
return Kernel::self()->isSystemFolderCollection(mCollection);
}
bool FolderCollection::isStructural() const
bool FolderSettings::isStructural() const
{
return mCollection.contentMimeTypes().isEmpty();
}
bool FolderCollection::isReadOnly() const
bool FolderSettings::isReadOnly() const
{
return mCollection.rights() & Akonadi::Collection::ReadOnly;
}
bool FolderCollection::canDeleteMessages() const
bool FolderSettings::canDeleteMessages() const
{
return mCollection.rights() & Akonadi::Collection::CanDeleteItem;
}
bool FolderCollection::canCreateMessages() const
bool FolderSettings::canCreateMessages() const
{
return mCollection.rights() & Akonadi::Collection::CanCreateItem;
}
qint64 FolderCollection::count() const
qint64 FolderSettings::count() const
{
return mCollection.statistics().count();
}
Akonadi::Collection::Rights FolderCollection::rights() const
Akonadi::Collection::Rights FolderSettings::rights() const
{
return mCollection.rights();
}
Akonadi::CollectionStatistics FolderCollection::statistics() const
Akonadi::CollectionStatistics FolderSettings::statistics() const
{
return mCollection.statistics();
}
void FolderCollection::setCollection(const Akonadi::Collection &collection)
void FolderSettings::setCollection(const Akonadi::Collection &collection)
{
mCollection = collection;
}
void FolderCollection::slotIdentitiesChanged()
void FolderSettings::slotIdentitiesChanged()
{
uint defaultIdentity = KernelIf->identityManager()->defaultIdentity().uoid();
// The default identity may have changed, therefore set it again if necessary
......@@ -186,12 +186,12 @@ void FolderCollection::slotIdentitiesChanged()
}
}
QString FolderCollection::configGroupName(const Akonadi::Collection &col)
QString FolderSettings::configGroupName(const Akonadi::Collection &col)
{
return QStringLiteral("Folder-%1").arg(QString::number(col.id()));
}
void FolderCollection::readConfig()
void FolderSettings::readConfig()
{
KConfigGroup configGroup(KernelIf->config(), configGroupName(mCollection));
mMailingListEnabled = configGroup.readEntry("MailingListEnabled", false);
......@@ -226,12 +226,12 @@ void FolderCollection::readConfig()
static_cast<int>(MessageViewer::Viewer::UseGlobalSetting)));
}
bool FolderCollection::isValid() const
bool FolderSettings::isValid() const
{
return mCollection.isValid();
}
void FolderCollection::writeConfig() const
void FolderSettings::writeConfig() const
{
KConfigGroup configGroup(KernelIf->config(), configGroupName(mCollection));
......@@ -284,19 +284,19 @@ void FolderCollection::writeConfig() const
}
}
void FolderCollection::setShortcut(const QKeySequence &sc)
void FolderSettings::setShortcut(const QKeySequence &sc)
{
if (mShortcut != sc) {
mShortcut = sc;
}
}
const QKeySequence &FolderCollection::shortcut() const
const QKeySequence &FolderSettings::shortcut() const
{
return mShortcut;
}
void FolderCollection::setUseDefaultIdentity(bool useDefaultIdentity)
void FolderSettings::setUseDefaultIdentity(bool useDefaultIdentity)
{
if (mUseDefaultIdentity != useDefaultIdentity) {
mUseDefaultIdentity = useDefaultIdentity;
......@@ -307,12 +307,12 @@ void FolderCollection::setUseDefaultIdentity(bool useDefaultIdentity)
}
}
bool FolderCollection::useDefaultIdentity() const
bool FolderSettings::useDefaultIdentity() const
{
return mUseDefaultIdentity;
}
void FolderCollection::setIdentity(uint identity)
void FolderSettings::setIdentity(uint identity)
{
if (mIdentity != identity) {
mIdentity = identity;
......@@ -320,7 +320,7 @@ void FolderCollection::setIdentity(uint identity)
}
}
uint FolderCollection::fallBackIdentity() const
uint FolderSettings::fallBackIdentity() const
{
int identityId = -1;
MailCommon::ResourceReadConfigFile resourceFile(mCollection.resource());
......@@ -342,7 +342,7 @@ uint FolderCollection::fallBackIdentity() const
return identityId;
}
uint FolderCollection::identity() const
uint FolderSettings::identity() const
{
if (mUseDefaultIdentity) {
return fallBackIdentity();
......@@ -350,7 +350,7 @@ uint FolderCollection::identity() const
return mIdentity;
}
QString FolderCollection::mailingListPostAddress() const
QString FolderSettings::mailingListPostAddress() const
{
if (mMailingList.features() & MailingList::Post) {
QList<QUrl> post = mMailingList.postUrls();
......@@ -367,7 +367,7 @@ QString FolderCollection::mailingListPostAddress() const
return QString();
}
void FolderCollection::setMailingListEnabled(bool enabled)
void FolderSettings::setMailingListEnabled(bool enabled)
{
if (mMailingListEnabled != enabled) {
mMailingListEnabled = enabled;
......@@ -375,12 +375,12 @@ void FolderCollection::setMailingListEnabled(bool enabled)
}
}
bool FolderCollection::isMailingListEnabled() const
bool FolderSettings::isMailingListEnabled() const
{
return mMailingListEnabled;
}
void FolderCollection::setMailingList(const MailingList &mlist)
void FolderSettings::setMailingList(const MailingList &mlist)
{
if (mMailingList == mlist) {
return;
......@@ -390,27 +390,27 @@ void FolderCollection::setMailingList(const MailingList &mlist)
writeConfig();
}
MessageCore::MailingList FolderCollection::mailingList() const
MessageCore::MailingList FolderSettings::mailingList() const
{
return mMailingList;
}
bool FolderCollection::putRepliesInSameFolder() const
bool FolderSettings::putRepliesInSameFolder() const
{
return mPutRepliesInSameFolder;
}
void FolderCollection::setPutRepliesInSameFolder(bool b)
void FolderSettings::setPutRepliesInSameFolder(bool b)
{
mPutRepliesInSameFolder = b;
}
bool FolderCollection::hideInSelectionDialog() const
bool FolderSettings::hideInSelectionDialog() const
{
return mHideInSelectionDialog;
}
void FolderCollection::setHideInSelectionDialog(bool hide)
void FolderSettings::setHideInSelectionDialog(bool hide)
{
mHideInSelectionDialog = hide;
}
......
......@@ -15,8 +15,8 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef MAILCOMMON_FOLDERCOLLECTION_H
#define MAILCOMMON_FOLDERCOLLECTION_H
#ifndef MAILCOMMON_FOLDERSETTINGS_H
#define MAILCOMMON_FOLDERSETTINGS_H
#include "mailcommon_export.h"
#include <MessageViewer/Viewer>
......@@ -34,15 +34,15 @@ using MessageCore::MailingList;
namespace MailCommon
{
class MAILCOMMON_EXPORT FolderCollection : public QObject
class MAILCOMMON_EXPORT FolderSettings : public QObject
{
Q_OBJECT
public:
static QSharedPointer<FolderCollection> forCollection(
static QSharedPointer<FolderSettings> forCollection(
const Akonadi::Collection &coll, bool writeConfig = true);
~FolderCollection();
~FolderSettings();
void setCollection(const Akonadi::Collection &collection);
......@@ -122,7 +122,7 @@ protected Q_SLOTS:
void slotIdentitiesChanged();
private:
explicit FolderCollection(const Akonadi::Collection &col, bool writeconfig);
explicit FolderSettings(const Akonadi::Collection &col, bool writeconfig);
Akonadi::Collection mCollection;
......
......@@ -18,7 +18,7 @@
*/
#include "foldertreewidgetproxymodel.h"
#include "foldercollection.h"
#include "foldersettings.h"
#include "kernel/mailkernel.h"
#include "util/mailutil.h"
......@@ -183,8 +183,8 @@ bool FolderTreeWidgetProxyModel::acceptRow(int sourceRow, const QModelIndex &sou
}
if (d->hideSpecificFolder) {
const QSharedPointer<FolderCollection> col =
FolderCollection::forCollection(collection, false);
const QSharedPointer<FolderSettings> col =
FolderSettings::forCollection(collection, false);
if (col && col->hideInSelectionDialog()) {
return false;
}
......
......@@ -42,7 +42,7 @@
#include "mailcommon_debug.h"
#include "calendarinterface.h"
#include "job/expirejob.h"
#include "folder/foldercollection.h"
#include "folder/foldersettings.h"
#include "pop3settings.h"
#include "kernel/mailkernel.h"
#include "filter/dialog/filteractionmissingargumentdialog.h"
......@@ -164,8 +164,8 @@ uint MailCommon::Util::folderIdentity(const Akonadi::Item &item)
if (col.resource().isEmpty()) {
col = parentCollectionFromItem(item);
}
const QSharedPointer<FolderCollection> fd =
FolderCollection::forCollection(col, false);
const QSharedPointer<FolderSettings> fd =
FolderSettings::forCollection(col, false);
id = fd->identity();
}
......@@ -384,7 +384,7 @@ MailCommon::ExpireCollectionAttribute *MailCommon::Util::expirationCollectionAtt
} else {
attr = new MailCommon::ExpireCollectionAttribute();
KConfigGroup configGroup(KernelIf->config(),
MailCommon::FolderCollection::configGroupName(collection));
MailCommon::FolderSettings::configGroupName(collection));
if (configGroup.hasKey("ExpireMessages")) {
attr->setAutoExpire(configGroup.readEntry("ExpireMessages", false));
......
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