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 96ab36f2 authored by Laurent Montel's avatar Laurent Montel 😁

Fix warning found by cppcheck

parent 7ee40e03
......@@ -58,11 +58,10 @@ void FilterOpera::importRecursive(const QDir &mailDir, const QString &accountNam
{
// Recursive import of the MBoxes.
const QStringList rootSubDirs = mailDir.entryList(QStringList(QStringLiteral("[^\\.]*")), QDir::Dirs, QDir::Name); // Removal of . and ..
int currentDir = 1;
int numSubDirs = rootSubDirs.size();
if (numSubDirs > 0) {
QStringList::ConstIterator end(rootSubDirs.constEnd());
for (QStringList::ConstIterator filename = rootSubDirs.constBegin(); filename != end; ++filename, ++currentDir) {
for (QStringList::ConstIterator filename = rootSubDirs.constBegin(); filename != end; ++filename) {
QDir importDir(mailDir.path() + QDir::separator() + *filename);
const QStringList files = importDir.entryList(QStringList(QStringLiteral("*.[mM][bB][sS]")), QDir::Files, QDir::Name);
if (files.isEmpty()) {
......
......@@ -55,13 +55,13 @@ void FilterPlain::importMails(const QString &mailDir)
// Count total number of files to be processed
filterInfo()->addInfoLogEntry(i18n("Counting files..."));
int totalFiles = files.count();
int currentFile = 0;
if (files.isEmpty()) {
filterInfo()->addErrorLogEntry(i18n("No files found for import."));
} else {
filterInfo()->addInfoLogEntry(i18n("Importing new mail files..."));
QStringList::ConstIterator end(files.constEnd());
const QString destName = QStringLiteral("PLAIN-%1").arg(dir.dirName());
int currentFile = 0;
for (QStringList::ConstIterator mailFile = files.constBegin(); mailFile != end; ++mailFile) {
const QString dirRealPath = dir.filePath(*mailFile);
filterInfo()->setFrom(dirRealPath);
......
......@@ -153,13 +153,12 @@ void FilterPMail::importMailFolder(const QString &file)
char id[42];
} pmm_head;
long l = 0;
QFile f(file);
if (!f.open(QIODevice::ReadOnly)) {
filterInfo()->alert(i18n("Unable to open %1, skipping", file));
} else {
// Get folder name
l = f.read((char *)&pmm_head, sizeof(pmm_head));
long l = f.read((char *)&pmm_head, sizeof(pmm_head));
QString folder(i18nc("define folder name when we will import pegasus mail", "PegasusMail-Import") + QLatin1Char('/'));
if (folderParsed) {
folder.append(getFolderName(QString::fromLatin1(pmm_head.id)));
......
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