Commit 54a340bd authored by Laurent Montel's avatar Laurent Montel 😁

Minor optimization

parent 2fbc490b
......@@ -42,13 +42,12 @@ AttachmentEditDialog::AttachmentEditDialog(AttachmentIconItem *item, QWidget *pa
,
#ifdef KDEPIM_ENTERPRISE_BUILD
mAttachment(new KCalCore::Attachment('\0'))
, //use the non-uri constructor
//use the non-uri constructor
// as we want inline by default
#else
mAttachment(new KCalCore::Attachment(QString()))
,
#endif
mItem(item)
, mItem(item)
, mUi(new Ui::AttachmentEditDialog)
{
setWindowTitle(i18n("Edit Attachment"));
......
......@@ -191,8 +191,7 @@ bool AttendeeTableModel::insertRows(int position, int rows, const QModelIndex &p
beginInsertRows(parent, position, position + rows - 1);
for (int row = 0; row < rows; ++row) {
KCalCore::Attendee::Ptr attendee(new KCalCore::Attendee(QLatin1String(""), QLatin1String(
"")));
KCalCore::Attendee::Ptr attendee(new KCalCore::Attendee(QLatin1String(""), QLatin1String("")));
mAttendeeList.insert(position, attendee);
}
......
......@@ -110,11 +110,9 @@ void CategoryWidget::setCategories(const QStringList &categoryList)
void CategoryWidget::setSelected(const QStringList &selList)
{
clear();
QStringList::ConstIterator it;
const bool remAutoCheckChildren = mWidgets->mCategories->autoCheckChildren();
mWidgets->mCategories->setAutoCheckChildren(false);
for (it = selList.begin(); it != selList.end(); ++it) {
for (QStringList::ConstIterator it = selList.begin(), end = selList.end(); it != end; ++it) {
QStringList path = CategoryHierarchyReader::path(*it);
QTreeWidgetItem *item = mWidgets->mCategories->itemByPath(path);
if (item) {
......
......@@ -93,11 +93,9 @@ void CategorySelectWidget::setCategories(const QStringList &categoryList)
void CategorySelectWidget::setSelected(const QStringList &selList)
{
clear();
QStringList::ConstIterator it;
bool remAutoCheckChildren = mWidgets->mCategories->autoCheckChildren();
mWidgets->mCategories->setAutoCheckChildren(false);
for (it = selList.begin(); it != selList.end(); ++it) {
for (QStringList::ConstIterator it = selList.begin(), end = selList.end(); it != end; ++it) {
QStringList path = CategoryHierarchyReader::path(*it);
QTreeWidgetItem *item = mWidgets->mCategories->itemByPath(path);
if (item) {
......
......@@ -351,8 +351,6 @@ void EditorItemManager::save()
if (d->mItem.isValid()) { // A valid item. Means we're modifying.
Q_ASSERT(d->mItem.parentCollection().isValid());
KCalCore::Incidence::Ptr incidence = CalendarSupport::incidence(d->mItem);
KCalCore::Incidence::Ptr oldPayload = CalendarSupport::incidence(d->mPrevItem);
if (d->mItem.parentCollection() == d->mItemUi->selectedCollection()
|| d->mItem.storageCollectionId() == d->mItemUi->selectedCollection().id()) {
......
......@@ -99,16 +99,12 @@ static QString freeBusyUrlStore()
void FreeBusyUrlWidget::loadConfig()
{
qCDebug(INCIDENCEEDITOR_LOG);
KConfig config(freeBusyUrlStore());
mUrlEdit->setText(config.group(mAttendee->email()).readEntry("url"));
}
void FreeBusyUrlWidget::saveConfig()
{
qCDebug(INCIDENCEEDITOR_LOG);
const QString url = mUrlEdit->text();
KConfig config(freeBusyUrlStore());
config.group(mAttendee->email()).writeEntry("url", url);
......
......@@ -363,7 +363,7 @@ void IncidenceAttendee::fillOrganizerCombo()
mUi->mOrganizerCombo->clear();
const QStringList lst = IncidenceEditorNG::EditorConfig::instance()->fullEmails();
QStringList uniqueList;
for (QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it) {
for (QStringList::ConstIterator it = lst.begin(), end = lst.end(); it != end; ++it) {
if (!uniqueList.contains(*it)) {
uniqueList << *it;
}
......
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