Ignore:
Timestamp:
Mar 29, 2012, 3:09:42 PM (13 years ago)
Author:
Silvan Scherrer
Message:

SMPlayer: update to latest svn

Location:
smplayer/vendor/current/src/findsubtitles
Files:
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • smplayer/vendor/current/src/findsubtitles/findsubtitles.pro

    r121 r127  
    1111HEADERS += simplehttp.h \
    1212           osparser.h \
     13           ../filehash.h \
    1314           ../lineedit_with_icon.h \
    1415           ../filechooser.h \
     
    1920SOURCES += simplehttp.cpp \
    2021           osparser.cpp \
     22           ../filehash.cpp \
    2123           ../lineedit_with_icon.cpp \
    2224           ../filechooser.cpp \
  • smplayer/vendor/current/src/findsubtitles/findsubtitleswindow.cpp

    r121 r127  
    2121#include "simplehttp.h"
    2222#include "osparser.h"
     23#include "filehash.h"
    2324#include "languages.h"
    2425#include <QStandardItemModel>
     
    244245        table->setRowCount(0);
    245246
    246         QString hash = OSParser::calculateHash(filename);
     247        QString hash = FileHash::calculateHash(filename);
    247248        if (hash.isEmpty()) {
    248249                qWarning("FindSubtitlesWindow::setMovie: hash invalid. Doing nothing.");
  • smplayer/vendor/current/src/findsubtitles/osparser.cpp

    r121 r127  
    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 
  • smplayer/vendor/current/src/findsubtitles/osparser.h

    r121 r127  
    4141        QList<OSSubtitle> subtitleList() { return s_list; };
    4242
    43         static QString calculateHash(QString filename);
    44 
    4543protected:
    4644        QDomDocument dom_document;
Note: See TracChangeset for help on using the changeset viewer.