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

Rename method

parent 072861ef
......@@ -308,7 +308,7 @@ bool Filter::checkForDuplicates(const QString &msgID,
return false;
}
bool Filter::doAddMessage(const QString &folderName,
bool Filter::importMessage(const QString &folderName,
const QString &msgPath,
bool duplicateCheck,
Akonadi::MessageStatus status)
......
......@@ -89,7 +89,7 @@ protected:
const Akonadi::Collection &msgCollection,
const QString &messageFolder);
bool doAddMessage(const QString &folderName,
bool importMessage(const QString &folderName,
const QString &msgPath,
bool duplicateCheck,
Akonadi::MessageStatus status = Akonadi::MessageStatus());
......
......@@ -209,7 +209,7 @@ void FilterBalsa::importFiles(const QString &dirName)
}
const Akonadi::MessageStatus status = statusFromFile(*mailFile);
if (! doAddMessage(_path, dir.filePath(*mailFile), filterInfo()->removeDupMessage(), status)) {
if (! importMessage(_path, dir.filePath(*mailFile), filterInfo()->removeDupMessage(), status)) {
filterInfo()->addErrorLogEntry(i18n("Could not import %1", *mailFile));
}
filterInfo()->setCurrent((int)((float) currentFile / numFiles * 100));
......
......@@ -194,7 +194,7 @@ void FilterEvolution::importMBox(const QString &mboxName, const QString &rootDir
destFolder = QLatin1String("Evolution-Import/") + destFolder;
}
doAddMessage(destFolder, tmp.fileName(), filterInfo()->removeDupMessage());
importMessage(destFolder, tmp.fileName(), filterInfo()->removeDupMessage());
const int currentPercentage = (int)(((float) mbox.pos() / filenameInfo.size()) * 100);
filterInfo()->setCurrent(currentPercentage);
......
......@@ -255,7 +255,7 @@ void FilterEvolution_v2::importMBox(const QString &mboxName, const QString &root
}
}
doAddMessage(destFolder, tmp.fileName(), filterInfo()->removeDupMessage());
importMessage(destFolder, tmp.fileName(), filterInfo()->removeDupMessage());
int currentPercentage = (int)(((float) mbox.pos() / filenameInfo.size()) * 100);
filterInfo()->setCurrent(currentPercentage);
......
......@@ -204,7 +204,7 @@ void FilterEvolution_v3::importFiles(const QString &dirName)
}
Akonadi::MessageStatus status = statusFromFile(*mailFile);
if (! doAddMessage(_path, dir.filePath(*mailFile), filterInfo()->removeDupMessage(), status)) {
if (! importMessage(_path, dir.filePath(*mailFile), filterInfo()->removeDupMessage(), status)) {
filterInfo()->addErrorLogEntry(i18n("Could not import %1", *mailFile));
}
filterInfo()->setCurrent((int)((float) currentFile / numFiles * 100));
......
......@@ -191,7 +191,7 @@ void FilterKMail_maildir::importFiles(const QString &dirName)
generatedPath = true;
}
if (!doAddMessage(_path, dir.filePath(*mailFile), filterInfo()->removeDupMessage())) {
if (!importMessage(_path, dir.filePath(*mailFile), filterInfo()->removeDupMessage())) {
filterInfo()->addErrorLogEntry(i18n("Could not import %1, duplicated message", *mailFile));
}
filterInfo()->setCurrent((int)((float) currentFile / numFiles * 100));
......
......@@ -146,7 +146,7 @@ void FilterLNotes::ImportLNotes(const QString &file)
// close file, send it
tempfile->close();
doAddMessage(folder, tempfile->fileName(), filterInfo()->removeDupMessage());
importMessage(folder, tempfile->fileName(), filterInfo()->removeDupMessage());
tempfile->setAutoRemove(true);
state = 0;
......@@ -175,7 +175,7 @@ void FilterLNotes::ImportLNotes(const QString &file)
if (state != 0) {
Q_ASSERT(tempfile);
doAddMessage(folder, tempfile->fileName(), filterInfo()->removeDupMessage());
importMessage(folder, tempfile->fileName(), filterInfo()->removeDupMessage());
}
if (tempfile) {
tempfile->setAutoRemove(true);
......
......@@ -122,7 +122,7 @@ void FilterMailApp::importMails(const QString &maildir)
tmp.flush();
first_msg = false;
doAddMessage(folderName, tmp.fileName(), filterInfo()->removeDupMessage());
importMessage(folderName, tmp.fileName(), filterInfo()->removeDupMessage());
int currentPercentage = (int)(((float) mbox.pos() / filenameInfo.size()) * 100);
filterInfo()->setCurrent(currentPercentage);
......
......@@ -119,7 +119,7 @@ void FilterMailmanGzip::importMails(const QStringList &filenames)
first_msg = false;
if (tmp.size() > 0) {
doAddMessage(folderName, tmp.fileName(), filterInfo()->removeDupMessage());
importMessage(folderName, tmp.fileName(), filterInfo()->removeDupMessage());
} else {
qCWarning(MAILIMPORTER_LOG) << "Message size is 0 bytes, not importing it.";
}
......
......@@ -116,7 +116,7 @@ void FilterMBox::importMails(const QStringList &filenames)
first_msg = false;
if (tmp.size() > 0) {
doAddMessage(folderName, tmp.fileName(), filterInfo()->removeDupMessage());
importMessage(folderName, tmp.fileName(), filterInfo()->removeDupMessage());
} else {
qCWarning(MAILIMPORTER_LOG) << "Message size is 0 bytes, not importing it.";
}
......
......@@ -211,7 +211,7 @@ void FilterOE::mbxImport(QDataStream &ds)
}
} while (!ds.atEnd());
tmp.flush();
doAddMessage(folderName, tmp.fileName(), filterInfo()->removeDupMessage());
importMessage(folderName, tmp.fileName(), filterInfo()->removeDupMessage());
if (filterInfo()->shouldTerminate()) {
return;
......@@ -375,7 +375,7 @@ void FilterOE::dbxReadEmail(QDataStream &ds, int filePos)
tmp.flush();
if (!_break) {
doAddMessage(folderName, tmp.fileName(), filterInfo()->removeDupMessage());
importMessage(folderName, tmp.fileName(), filterInfo()->removeDupMessage());
currentEmail++;
int currentPercentage = (int)(((float) currentEmail / totalEmails) * 100);
......
......@@ -121,7 +121,7 @@ void FilterOpera::importBox(const QDir &importDir, const QStringList &files, con
tmp.flush();
first_msg = false;
doAddMessage(folderName, tmp.fileName(), filterInfo()->removeDupMessage());
importMessage(folderName, tmp.fileName(), filterInfo()->removeDupMessage());
int currentPercentage = (int)(((float) operaArchiv.pos() / filenameInfo.size()) * 100);
filterInfo()->setCurrent(currentPercentage);
......
......@@ -61,7 +61,7 @@ void FilterPlain::import()
filterInfo()->setFrom(dirRealPath);
filterInfo()->setTo(destName);
filterInfo()->setCurrent(0);
if (! doAddMessage(destName, dirRealPath, filterInfo()->removeDupMessage())) {
if (! importMessage(destName, dirRealPath, filterInfo()->removeDupMessage())) {
filterInfo()->addErrorLogEntry(i18n("Could not import %1", *mailFile));
}
......
......@@ -116,7 +116,7 @@ void FilterPMail::importNewMessage(const QString &file)
QString destFolder(QStringLiteral("PegasusMail-Import/New Messages"));
filterInfo()->setTo(destFolder);
doAddMessage(destFolder, file, filterInfo()->removeDupMessage());
importMessage(destFolder, file, filterInfo()->removeDupMessage());
}
/** this function imports one mail folder file (*.PMM) */
......@@ -194,7 +194,7 @@ void FilterPMail::importMailFolder(const QString &file)
}
}
tempfile.flush();
doAddMessage(folder, tempfile.fileName(), filterInfo()->removeDupMessage());
importMessage(folder, tempfile.fileName(), filterInfo()->removeDupMessage());
first_msg = false;
}
......@@ -257,7 +257,7 @@ void FilterPMail::importUnixMailFolder(const QString &file)
}
}
tempfile.flush();
doAddMessage(folder, tempfile.fileName(), filterInfo()->removeDupMessage());
importMessage(folder, tempfile.fileName(), filterInfo()->removeDupMessage());
n++;
filterInfo()->setCurrent(i18n("Message %1", n));
......
......@@ -246,7 +246,7 @@ void FilterSylpheed::importFiles(const QString &dirName)
} else {
status.setRead(true); // 0 == read
}
if (! doAddMessage(_path, dir.filePath(*mailFile), filterInfo()->removeDupMessage(), status)) {
if (! importMessage(_path, dir.filePath(*mailFile), filterInfo()->removeDupMessage(), status)) {
filterInfo()->addErrorLogEntry(i18n("Could not import %1", *mailFile));
}
filterInfo()->setCurrent((int)((float) currentFile / numFiles * 100));
......
......@@ -246,7 +246,7 @@ void FilterTheBat::importFiles(const QString &FileName)
tmp.write(input, endPos - lastPos);
tmp.flush();
doAddMessage(_path, tmp.fileName(), filterInfo()->removeDupMessage());
importMessage(_path, tmp.fileName(), filterInfo()->removeDupMessage());
lastPos = endPos + 48;
tbb.seek(lastPos);
......
......@@ -323,7 +323,7 @@ void FilterThunderbird::importMBox(const QString &mboxName, const QString &rootD
}
}
doAddMessage(destFolder, tmp.fileName(), filterInfo()->removeDupMessage());
importMessage(destFolder, tmp.fileName(), filterInfo()->removeDupMessage());
int currentPercentage = (int)(((float) mbox.pos() / filenameInfo.size()) * 100);
filterInfo()->setCurrent(currentPercentage);
......
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