Commit e3edd77c authored by Scott Wheeler's avatar Scott Wheeler
Browse files

Another quick fix (ripping CDs at work, catching bugs ;-) ) -- store the

files mtime in the cache based on when the tag was read, not when the file was
last read.

svn path=/trunk/kdemultimedia/juk/; revision=218058
parent 4f9dc316
...@@ -65,6 +65,13 @@ Tag::~Tag() ...@@ -65,6 +65,13 @@ Tag::~Tag()
Tag::Tag(const QString &file) : m_info(file), m_fileName(file) Tag::Tag(const QString &file) : m_info(file), m_fileName(file)
{ {
Cache::instance()->insert(file, this); Cache::instance()->insert(file, this);
// We want to stamp the file with the modified time when the tag is
// created. Otherwise the file can be modified while JuK is running and
// it will never be updated because the m_info.lastModifed() would return
// that timestamp when creating the cache.
m_lastModified = m_info.lastModified();
} }
QString Tag::readBitrate(const KFileMetaInfo &metaInfo) QString Tag::readBitrate(const KFileMetaInfo &metaInfo)
......
...@@ -83,7 +83,7 @@ public: ...@@ -83,7 +83,7 @@ public:
// performance critical section of JuK. // performance critical section of JuK.
inline QString absFilePath() const { return m_fileName; } inline QString absFilePath() const { return m_fileName; }
inline QDateTime lastModified() const { return m_info.lastModified(); } inline QDateTime lastModified() const { return m_lastModified; }
inline bool fileExists() const { return m_info.exists() && m_info.isFile(); } inline bool fileExists() const { return m_info.exists() && m_info.isFile(); }
inline QFileInfo fileInfo() const { return m_info; } inline QFileInfo fileInfo() const { return m_info; }
...@@ -103,6 +103,7 @@ protected: ...@@ -103,6 +103,7 @@ protected:
private: private:
QFileInfo m_info; QFileInfo m_info;
QString m_fileName; QString m_fileName;
QDateTime m_lastModified;
}; };
QDataStream &operator<<(QDataStream &s, const Tag &t); QDataStream &operator<<(QDataStream &s, const Tag &t);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment