summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/opensearch/opensearchengine.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/opensearch/opensearchengine.cpp b/src/opensearch/opensearchengine.cpp
index 15228455..926a9976 100644
--- a/src/opensearch/opensearchengine.cpp
+++ b/src/opensearch/opensearchengine.cpp
@@ -35,6 +35,8 @@
// Qt Includes
#include <QtCore/QRegExp>
#include <QtCore/QFile>
+#include <QtCore/QFileInfo>
+#include <QtCore/QDateTime>
// KDE Includes
#include <KStandardDirs>
@@ -286,7 +288,8 @@ QString OpenSearchEngine::suggestionPathFor(const QString &searchTerm)
bool OpenSearchEngine::hasCachedSuggestionsFor(const QString &searchTerm)
{
- return QFile::exists(suggestionPathFor(searchTerm));
+ QFileInfo info(suggestionPathFor(searchTerm));
+ return info.exists() && info.lastModified().daysTo(QDateTime::currentDateTime()) < 7;
}