Changeset View
Changeset View
Standalone View
Standalone View
shared/MetaTagLib.cpp
Show All 33 Lines | |||||
34 | #include <QImage> | 34 | #include <QImage> | ||
35 | #include <QBuffer> | 35 | #include <QBuffer> | ||
36 | #include <QDir> | 36 | #include <QDir> | ||
37 | #include <QFile> | 37 | #include <QFile> | ||
38 | #include <QFileInfo> | 38 | #include <QFileInfo> | ||
39 | #include <QCryptographicHash> | 39 | #include <QCryptographicHash> | ||
40 | #include <QMutex> | 40 | #include <QMutex> | ||
41 | #include <QMutexLocker> | 41 | #include <QMutexLocker> | ||
42 | #include <QString> | ||||
42 | #include <QTime> | 43 | #include <QTime> | ||
43 | #include <QDebug> | | |||
44 | 44 | | |||
45 | #include "FileTypeResolver.h" | 45 | #include "FileTypeResolver.h" | ||
46 | #include "MetaReplayGain.h" | 46 | #include "MetaReplayGain.h" | ||
47 | #include "tag_helpers/TagHelper.h" | 47 | #include "tag_helpers/TagHelper.h" | ||
48 | #include "tag_helpers/StringHelper.h" | 48 | #include "tag_helpers/StringHelper.h" | ||
49 | 49 | | |||
50 | //Taglib: | 50 | //Taglib: | ||
51 | #include <audioproperties.h> | 51 | #include <audioproperties.h> | ||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | |||||
108 | // ----------------------- unique id ------------------------ | 108 | // ----------------------- unique id ------------------------ | ||
109 | 109 | | |||
110 | 110 | | |||
111 | void | 111 | void | ||
112 | Meta::Tag::addRandomness( QCryptographicHash *md5 ) | 112 | Meta::Tag::addRandomness( QCryptographicHash *md5 ) | ||
113 | { | 113 | { | ||
114 | //md5 has size of file already added for some little extra randomness for the hash | 114 | //md5 has size of file already added for some little extra randomness for the hash | ||
115 | qsrand( QTime::currentTime().msec() ); | 115 | qsrand( QTime::currentTime().msec() ); | ||
116 | md5->addData( QString::number( qrand() ).toAscii() ); | 116 | md5->addData( QString::number( qrand() ).toLatin1() ); | ||
117 | md5->addData( QString::number( qrand() ).toAscii() ); | 117 | md5->addData( QString::number( qrand() ).toLatin1() ); | ||
118 | md5->addData( QString::number( qrand() ).toAscii() ); | 118 | md5->addData( QString::number( qrand() ).toLatin1() ); | ||
119 | md5->addData( QString::number( qrand() ).toAscii() ); | 119 | md5->addData( QString::number( qrand() ).toLatin1() ); | ||
120 | md5->addData( QString::number( qrand() ).toAscii() ); | 120 | md5->addData( QString::number( qrand() ).toLatin1() ); | ||
121 | md5->addData( QString::number( qrand() ).toAscii() ); | 121 | md5->addData( QString::number( qrand() ).toLatin1() ); | ||
122 | md5->addData( QString::number( qrand() ).toAscii() ); | 122 | md5->addData( QString::number( qrand() ).toLatin1() ); | ||
123 | } | 123 | } | ||
124 | 124 | | |||
125 | TagLib::ByteVector | 125 | TagLib::ByteVector | ||
126 | Meta::Tag::generatedUniqueIdHelper( const TagLib::FileRef &fileref ) | 126 | Meta::Tag::generatedUniqueIdHelper( const TagLib::FileRef &fileref ) | ||
127 | { | 127 | { | ||
128 | TagLib::ByteVector bv; | 128 | TagLib::ByteVector bv; | ||
129 | 129 | | |||
130 | TagHelper *tagHelper = selectHelper( fileref ); | 130 | TagHelper *tagHelper = selectHelper( fileref ); | ||
▲ Show 20 Lines • Show All 222 Lines • Show Last 20 Lines |