Changeset View
Changeset View
Standalone View
Standalone View
resources/maildir/maildirresource.cpp
Show First 20 Lines • Show All 459 Lines • ▼ Show 20 Line(s) | 445 | { | |||
---|---|---|---|---|---|
460 | } | 460 | } | ||
461 | qCDebug(MAILDIRRESOURCE_LOG) << "Item removed" << item.id() << " in collection :" << item.parentCollection().id(); | 461 | qCDebug(MAILDIRRESOURCE_LOG) << "Item removed" << item.id() << " in collection :" << item.parentCollection().id(); | ||
462 | changeProcessed(); | 462 | changeProcessed(); | ||
463 | } | 463 | } | ||
464 | 464 | | |||
465 | Collection::List MaildirResource::listRecursive(const Collection &root, const Maildir &dir) | 465 | Collection::List MaildirResource::listRecursive(const Collection &root, const Maildir &dir) | ||
466 | { | 466 | { | ||
467 | if (mSettings->monitorFilesystem()) { | 467 | if (mSettings->monitorFilesystem()) { | ||
468 | mFsWatcher->addDir(dir.path() + QDir::separator() + QLatin1String("new")); | 468 | mFsWatcher->addDir(dir.path() + QStringLiteral("/new")); | ||
469 | mFsWatcher->addDir(dir.path() + QDir::separator() + QLatin1String("cur")); | 469 | mFsWatcher->addDir(dir.path() + QStringLiteral("/cur")); | ||
470 | mFsWatcher->addDir(dir.subDirPath()); | 470 | mFsWatcher->addDir(dir.subDirPath()); | ||
471 | if (dir.isRoot()) { | 471 | if (dir.isRoot()) { | ||
472 | mFsWatcher->addDir(dir.path()); | 472 | mFsWatcher->addDir(dir.path()); | ||
473 | } | 473 | } | ||
474 | } | 474 | } | ||
475 | 475 | | |||
476 | Collection::List list; | 476 | Collection::List list; | ||
477 | const QStringList mimeTypes = QStringList() << itemMimeType() << Collection::mimeType(); | 477 | const QStringList mimeTypes = QStringList() << itemMimeType() << Collection::mimeType(); | ||
▲ Show 20 Lines • Show All 93 Lines • ▼ Show 20 Line(s) | 566 | { | |||
571 | } | 571 | } | ||
572 | 572 | | |||
573 | Maildir md = maildirForCollection(parent); | 573 | Maildir md = maildirForCollection(parent); | ||
574 | qCDebug(MAILDIRRESOURCE_LOG) << md.subFolderList(); | 574 | qCDebug(MAILDIRRESOURCE_LOG) << md.subFolderList(); | ||
575 | if (mSettings->readOnly() || !md.isValid()) { | 575 | if (mSettings->readOnly() || !md.isValid()) { | ||
576 | changeProcessed(); | 576 | changeProcessed(); | ||
577 | return; | 577 | return; | ||
578 | } else { | 578 | } else { | ||
579 | const QString collectionName(collection.name().remove(QDir::separator())); | 579 | const QString collectionName(collection.name().remove(QLatin1Char('/'))); | ||
580 | const QString newFolderPath = md.addSubFolder(collectionName); | 580 | const QString newFolderPath = md.addSubFolder(collectionName); | ||
581 | if (newFolderPath.isEmpty()) { | 581 | if (newFolderPath.isEmpty()) { | ||
582 | changeProcessed(); | 582 | changeProcessed(); | ||
583 | return; | 583 | return; | ||
584 | } | 584 | } | ||
585 | 585 | | |||
586 | qCDebug(MAILDIRRESOURCE_LOG) << md.subFolderList(); | 586 | qCDebug(MAILDIRRESOURCE_LOG) << md.subFolderList(); | ||
587 | 587 | | |||
Show All 28 Lines | 596 | { | |||
616 | Maildir md = maildirForCollection(collection); | 616 | Maildir md = maildirForCollection(collection); | ||
617 | if (!md.isValid()) { | 617 | if (!md.isValid()) { | ||
618 | assert(!collection.remoteId().isEmpty()); // caught in resourcebase | 618 | assert(!collection.remoteId().isEmpty()); // caught in resourcebase | ||
619 | // we don't have a maildir for this collection yet, probably due to a race | 619 | // we don't have a maildir for this collection yet, probably due to a race | ||
620 | // make one, otherwise the rename below will fail | 620 | // make one, otherwise the rename below will fail | ||
621 | md.create(); | 621 | md.create(); | ||
622 | } | 622 | } | ||
623 | 623 | | |||
624 | const QString collectionName(collection.name().remove(QDir::separator())); | 624 | const QString collectionName(collection.name().remove(QLatin1Char('/'))); | ||
625 | if (!md.rename(collectionName)) { | 625 | if (!md.rename(collectionName)) { | ||
626 | Q_EMIT error(i18n("Unable to rename maildir folder '%1'.", collection.name())); | 626 | Q_EMIT error(i18n("Unable to rename maildir folder '%1'.", collection.name())); | ||
627 | changeProcessed(); | 627 | changeProcessed(); | ||
628 | return; | 628 | return; | ||
629 | } | 629 | } | ||
630 | Collection c(collection); | 630 | Collection c(collection); | ||
631 | c.setRemoteId(collectionName); | 631 | c.setRemoteId(collectionName); | ||
632 | c.setName(collectionName); | 632 | c.setName(collectionName); | ||
▲ Show 20 Lines • Show All 254 Lines • Show Last 20 Lines |