[FIX] Compute the md5 in the wrong way.错误的计算了md5值。
This commit is contained in:
parent
9d0fb57fa5
commit
ee7ff13017
|
@ -45,7 +45,7 @@ FileUtils::FileUtils()
|
||||||
|
|
||||||
std::string FileUtils::makeDocUterm(QString path)
|
std::string FileUtils::makeDocUterm(QString path)
|
||||||
{
|
{
|
||||||
return QCryptographicHash::hash(path.toUtf8(),QCryptographicHash::Md5).toStdString();
|
return QCryptographicHash::hash(path.toUtf8(),QCryptographicHash::Md5).toHex().toStdString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -56,6 +56,11 @@ void ConstructDocumentForPath::run()
|
||||||
|
|
||||||
QString uniqueterm = QString::fromStdString(FileUtils::makeDocUterm(sourcePath));
|
QString uniqueterm = QString::fromStdString(FileUtils::makeDocUterm(sourcePath));
|
||||||
QString upTerm = QString::fromStdString(FileUtils::makeDocUterm(sourcePath.section("/",0,-2,QString::SectionIncludeLeadingSep)));
|
QString upTerm = QString::fromStdString(FileUtils::makeDocUterm(sourcePath.section("/",0,-2,QString::SectionIncludeLeadingSep)));
|
||||||
|
// qDebug()<<"sourcePath"<<sourcePath.section("/",0,-2,QString::SectionIncludeLeadingSep);
|
||||||
|
// qDebug() << "sourcePath ---------------------------: " << sourcePath;
|
||||||
|
// qDebug() << "sourcePath.section -------------------: " << sourcePath.section("/",0,-2,QString::SectionIncludeLeadingSep);
|
||||||
|
// qDebug() << "ConstructDocumentForPath -- uniqueterm: " << uniqueterm;
|
||||||
|
// qDebug() << "ConstructDocumentForPath -- upTerm: " << upTerm;
|
||||||
|
|
||||||
Document doc;
|
Document doc;
|
||||||
doc.setData(sourcePath);
|
doc.setData(sourcePath);
|
||||||
|
|
|
@ -98,7 +98,7 @@ bool InotifyIndex::AddWatch(const QString &path){
|
||||||
// Q_ASSERT(ret != -1);
|
// Q_ASSERT(ret != -1);
|
||||||
assert(ret != -1);
|
assert(ret != -1);
|
||||||
currentPath[ret] = path;
|
currentPath[ret] = path;
|
||||||
//qDebug() << "Watch:" << path;
|
// qDebug() << "Watch: " << path << "ret: " << ret;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,6 +131,7 @@ bool InotifyIndex::RemoveWatch(const QString &path){
|
||||||
IndexGenerator::getInstance()->deleteAllIndex(new QStringList(i.value()));
|
IndexGenerator::getInstance()->deleteAllIndex(new QStringList(i.value()));
|
||||||
/*--------------------------------*/
|
/*--------------------------------*/
|
||||||
currentPath.erase(i++);
|
currentPath.erase(i++);
|
||||||
|
// i++;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
i++;
|
i++;
|
||||||
|
@ -142,7 +143,7 @@ bool InotifyIndex::RemoveWatch(const QString &path){
|
||||||
}
|
}
|
||||||
// qDebug() << path;
|
// qDebug() << path;
|
||||||
//这个貌似不用删,先mark一下
|
//这个貌似不用删,先mark一下
|
||||||
currentPath.remove(currentPath.key(path));
|
// currentPath.remove(currentPath.key(path));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,6 +157,7 @@ void InotifyIndex::eventProcess(const char* buf, ssize_t tmp){
|
||||||
|
|
||||||
for (; p < buf + numRead;) {
|
for (; p < buf + numRead;) {
|
||||||
struct inotify_event * event = reinterpret_cast<inotify_event *>(p);
|
struct inotify_event * event = reinterpret_cast<inotify_event *>(p);
|
||||||
|
qDebug() << "Read Event event->wd: " << event->wd;
|
||||||
qDebug() << "Read Event: " << currentPath[event->wd] << QString(event->name) << event->cookie << event->wd << event->mask;
|
qDebug() << "Read Event: " << currentPath[event->wd] << QString(event->name) << event->cookie << event->wd << event->mask;
|
||||||
if(event->name[0] != '.'){
|
if(event->name[0] != '.'){
|
||||||
qDebug() << QString(currentPath[event->wd] + '/' + event->name);
|
qDebug() << QString(currentPath[event->wd] + '/' + event->name);
|
||||||
|
|
Loading…
Reference in New Issue