47
QString FilterSylpheed::defaultPath()
47
QString FilterSylpheed::defaultSettingsPath()
49
49
return QDir::homePath() + QLatin1String( "/.sylpheed-2.0/" );
52
52
QString FilterSylpheed::localMailDirPath()
54
QFile folderListFile( defaultPath() + QLatin1String( "/folderlist.xml" ) );
54
QFile folderListFile( FilterSylpheed::defaultSettingsPath() + QLatin1String( "/folderlist.xml" ) );
55
55
if ( folderListFile.exists() ) {
162
162
processDirectory( dirName );
165
bool FilterSylpheed::excludeFile(const QString& file)
167
if(file.endsWith(QLatin1String(".sylpheed_cache")) ||
168
file.endsWith(QLatin1String(".sylpheed_mark")) ||
169
file.endsWith(QLatin1String(".mh_sequences")) ) {
175
QString FilterSylpheed::defaultInstallFolder() const
177
return i18nc("define folder name where we will import sylpheed mails", "Sylpheed-Import") + QLatin1Char('/');
180
QString FilterSylpheed::markFile() const
182
return QString::fromLatin1(".sylpheed_mark");
167
186
* Import the files within a Folder.
177
196
QHash<QString,unsigned long> msgflags;
179
198
QDir importDir (dirName);
199
const QString defaultInstallPath = defaultInstallFolder();
180
201
const QStringList files = importDir.entryList(QStringList("[^\\.]*"), QDir::Files, QDir::Name);
181
202
int currentFile = 1, numFiles = files.size();
183
readMarkFile(dir.filePath(".sylpheed_mark"), msgflags);
204
readMarkFile(dir.filePath(markFile()), msgflags);
185
206
QStringList::ConstIterator end( files.constEnd() );
186
207
for ( QStringList::ConstIterator mailFile = files.constBegin(); mailFile != end; ++mailFile, ++currentFile) {
187
208
if(filterInfo()->shouldTerminate())
189
210
QString _mfile = *mailFile;
190
if (!(_mfile.endsWith(QLatin1String(".sylpheed_cache")) || _mfile.endsWith(QLatin1String(".sylpheed_mark"))
191
|| _mfile.endsWith(QLatin1String(".mh_sequences")) )) {
211
if (!excludeFile(_mfile)) {
192
212
if(!generatedPath) {
193
//FIXME: Why recreate all the time _path ?
195
_path = i18nc("define folder name where we will import sylpheed mails", "Sylpheed-Import") + QLatin1Char('/');
213
_path = defaultInstallPath;
196
214
QString _tmp = dir.filePath(*mailFile);
197
215
_tmp = _tmp.remove(_tmp.length() - _mfile.length() -1, _mfile.length()+1);
198
216
_path += _tmp.remove( mailDir(), Qt::CaseSensitive );