Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Oded Arbel
Baloo
Commits
f967f24a
Commit
f967f24a
authored
Dec 09, 2013
by
Vishesh Handa
Browse files
time_t bug
parent
26dc804e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/core/tests/querytest.cpp
View file @
f967f24a
...
...
@@ -24,6 +24,8 @@
#include
<QApplication>
#include
<QTimer>
#include
<QFileInfo>
#include
<QDateTime>
#include
<KDebug>
#include
<iostream>
...
...
@@ -41,6 +43,21 @@ private Q_SLOTS:
int
main
(
int
argc
,
char
**
argv
)
{
/*
QString str("2012-10-28T02:03:01");
QDateTime mtime = QDateTime::fromString(str, Qt::ISODate);
uint t = 1351382581;
QDateTime lm = QDateTime::fromTime_t(t);
qDebug() << lm << mtime;
bool r1 = mtime != lm;
bool r2 = mtime != lm;
qDebug() << r1 << r2;
return 0;
*/
App
app
(
argc
,
argv
);
if
(
argc
!=
2
)
{
...
...
src/file/basicindexingqueue.cpp
View file @
f967f24a
...
...
@@ -177,8 +177,12 @@ bool BasicIndexingQueue::shouldIndex(FileMapping& file, const QString& mimetype)
const
QString
str
=
QString
::
fromStdString
(
*
it
).
mid
(
4
);
const
QDateTime
mtime
=
QDateTime
::
fromString
(
str
,
Qt
::
ISODate
);
if
(
mtime
!=
fileInfo
.
lastModified
())
const
QDateTime
lm
=
fileInfo
.
lastModified
();
// Using time_t because there seems to be a bug in QDateTime::fromTime_t which is what
// QFileInfo::lastModified uses internally
if
(
lm
.
toTime_t
()
!=
mtime
.
toTime_t
())
{
return
true
;
}
}
catch
(
const
Xapian
::
DocNotFoundError
&
)
{
return
true
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment