summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDon Sanders <don.sanders@nokia.com>2011-06-03 11:57:37 +0300
committerDon Sanders <don.sanders@nokia.com>2011-06-03 11:57:37 +0300
commit963853f94a8eff8b1b8973ddd7e6f1185883feab (patch)
treecb8a77e82afc86f4d889065f2e405d1a5dbaa7d5
parent5c3347ccbdd493f5cb61bb6501df953bec6fb1ef (diff)
Fix for NB#259331 - does not show new emails immediately
Patch from Eric.
-rw-r--r--CHANGES1
-rw-r--r--src/libraries/qmfclient/support/qmailnamespace.cpp20
2 files changed, 18 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index 67d9f0b9..c591a37e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,7 @@ Latest Changes
---------------
201122
+ * Fixes: NB#259331 Does not show new emails immediately
* Fixes: NB#249858 Random crash observed with assert
201121
diff --git a/src/libraries/qmfclient/support/qmailnamespace.cpp b/src/libraries/qmfclient/support/qmailnamespace.cpp
index 56256475..368f9479 100644
--- a/src/libraries/qmfclient/support/qmailnamespace.cpp
+++ b/src/libraries/qmfclient/support/qmailnamespace.cpp
@@ -235,11 +235,25 @@ QString QMail::dataPath()
*/
QDateTime QMail::lastDbUpdated()
{
- static QString path(dataPath() + "database/qmailstore.db");
- QFileInfo info(path);
+ static QString database_path(dataPath() + "database");
+ QDir dir(database_path);
+
+ if (!dir.exists()) {
+ qWarning() << Q_FUNC_INFO << " database dir doesn't exist";
+ return QDateTime();
+ }
+
+ QStringList entries(dir.entryList(QDir::NoFilter, QDir::Time));
+
+ if (entries.empty()) {
+ qWarning() << Q_FUNC_INFO << " found nothing in database dir";
+ return QDateTime();
+ }
+
+ QFileInfo info(dir, entries.first());
if (!info.exists()) {
- qWarning() << Q_FUNC_INFO << "Store file does not exist";
+ qWarning() << Q_FUNC_INFO << "Could not open file we just found?";
return QDateTime();
}