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

Rename method

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