Ignore:
Timestamp:
Mar 29, 2012, 4:53:15 PM (13 years ago)
Author:
Silvan Scherrer
Message:

SMPlayer: trunk update to latest svn

Location:
smplayer/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • smplayer/trunk

  • smplayer/trunk/src/findsubtitles/osparser.cpp

    r124 r128  
    1919#include "osparser.h"
    2020#include <QDomDocument>
    21 #include <QFile>
    22 #include <QDataStream>
     21//#include <QFile>
     22//#include <QDataStream>
    2323
    2424OSParser::OSParser() {
     
    8181}
    8282
    83 // From the patch by Kamil Dziobek turbos11(at)gmail.com
    84 // (c) Kamil Dziobek turbos11(at)gmail.com | BSD or GPL or public domain
    85 QString OSParser::calculateHash(QString filename) {
    86         QFile file(filename);
    87 
    88         if (!file.exists()) {
    89                 qWarning("OSParser:calculateHash: error hashing file. File doesn't exist.");
    90                 return QString();
    91         }
    92 
    93         file.open(QIODevice::ReadOnly);
    94         QDataStream in(&file);
    95         in.setByteOrder(QDataStream::LittleEndian);
    96         quint64 size=file.size ();
    97         quint64 hash=size;
    98         quint64 a;
    99         for(int i = 0; i < 8192; i++) {
    100                 in >> a ; hash += a;
    101         };
    102         file.seek(size-65536);
    103         for(int i = 0; i < 8192; i++) {
    104                 in >> a ; hash += a;
    105         };
    106 
    107         QString hexhash = QString("%1").arg(hash, 16, 16, QChar('0'));
    108 
    109         return hexhash;
    110 }
    111 
Note: See TracChangeset for help on using the changeset viewer.